Closed xNorbig closed 9 years ago
You should use "with" instead of "by" but well yes that doesn't work.
Syntax: enchant %~item stack% with %enchantment types%
Because enchantment type is a type and not a expression it only takes literals and no variables or expressions. Which was actually not a super good idea by njol when he could have made it to a expression rather than type as then you could have used variables or expressions.
But there's actually a way for making this work because of the parse expression.
set {_strength} to 2
set {_enchant} to sharpness
set {_realEnchant} to "%{_enchant}% %{_strength}%" parsed as enchantment type
if {_realEnchant} is set:
enchant player's tool with {_realEnchant}
enchant player's tool by {_enchantment} of {_strenght} doesn't works