Trying to hide all unwanted enchanted books; what am I doing wrong?
startup_scripts
global.disEnchantments = [
'enderzoology:soulbound',
'enderio:soulbound',
'ars_elemental:soulbound',
'miniutilities:molten_head',
'miniutilities:shotgun',
'miniutilities:experience_harvester'
];
server_scripts
-# i am using weakNBT() because books come in multiple levels
ServerEvents.tags('item', event => {
// ENCH REMOVAL
global.disEnchantments.forEach(e => {
console.log(Item.of('minecraft:enchanted_book','{StoredEnchantments:[{id:"'+e+'"}]}').weakNBT());
event.add('c:hidden_from_recipe_viewers', Item.of('minecraft:enchanted_book','{StoredEnchantments:[{id:"'+e+'"}]}').weakNBT());
})
})