// 1. Zenith & Weapon Tags
ServerEvents.tags('item', event => {
    // FIXED: Wrapped all Regex patterns in string quotes
    const meleeMods = [
        '/wizards:.*/', 
        '/elemental_wizards_rpg:.*/', 
        '/paladins:.*/', 
        '/rogues:.*/', 
        '/berserker_rpg:.*/', 
        '/forcemaster_rpg:.*/', 
        '/death_knights:.*/'
    ];
    const rangedMods = ['/archers:.*/'];

    event.add('c:swords', meleeMods);
    event.add('c:weapons/melee', meleeMods);
    event.add('c:weapons/ranged', rangedMods);
    
    // FIXED: Wrapped heavy weapon Regex patterns in string quotes
    event.add('zenith:affix_heavy_weapons', [
        '/paladins:.*hammer/', 
        '/paladins:.*claymore/', 
        '/death_knights:.*greatsword/'
    ]);
    
    // Hide Enchanting Table from EMI/Recipe Viewers
    event.add('c:hidden_from_recipe_viewers', 'minecraft:enchanting_table');
})

// 2. Interaction Restrictions
BlockEvents.rightClicked('minecraft:enchanting_table', event => {
    event.cancel();
})

BlockEvents.broken('minecraft:spawner', event => {
    event.player.displayClientMessage(Text.red("You strike the iron, but the echoes of the past weave the cage back together."), true);
    event.cancel();
})