#how do i ban a specific enchantment on a specific item?
23 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
You would have to download the add -on MoreJS and use the MoreJSEvents.filterAvailableEnchantments remove event on the items you don’t want to be able to have sharpness.
Although if you have the blunt items in loot tables they could still show up in chests with sharpness
would it be possible to use tags for filtering criteria?
I don’t think so. The method on the wiki is getItem() so you’d have to run the items individually through a loop
could you send the link to the wiki page?
A Minecraft mod to extend KubeJS with additional events. - AlmostReliable/morejs
thanks will try how it works
Ticket re-opened!
i tried to understand how it works based on the wiki but i dont know how to do it for an item
@modern oar could you help me?
should be something like this ```js
MoreJSEvents.filterAvailableEnchantments((event) => {
if (event.item.id != 'minecraft:diamond_sword') return
// Remove the given enchantment only for diamond swords
event.remove("minecraft:unbreaking");
});```
can also go off tags like this js if (!event.item.hasTag('forge:swords')) return
will this work with /reload or not?
doesnt seem to work but no crashes thankfully
sharp 5 and sharp 1 still work in an anvil so its not a matter of lvl
show script
MoreJSEvents.filterAvailableEnchantments((event) => {
if (event.item.id != 'minecraft:diamond_sword') return
// Remove the given enchantment only for diamond swords
event.remove("minecraft:sharpness");
})
alright the issue resolved itself as i no longer need to remove that enchant
