Taką funkcję znalazłem w Internecie zaznaczoną jako "działającą", nietestowane.
Wygląda sensownie, jednakże nie wiem, jak zadziała gdyż post jest z 2017 roku....
function removeEnch(i: item, e: enchantment):
loop enchantments of {_i}:
add "%loop-value% %level of loop-value of {_i}%" parsed as an enchantment type to {_e::*}
disenchant {_i}
loop {_e::*}:
if "%loop-value%" does not contain "%{_e}%":
enchant {_i} with loop-value
Z tą funkcją twój kod powinien wyglądać tak:
command /disench:
trigger:
if player's tool is enchanted with Curse of Binding:
removeEnch(player's tool, Curse of Binding)