I'm making a skript that should open a GUI where you can upgrade the efficiency level by right clicking a diamond pickaxe. The efficiency level should rise by one everytime you click the enchanted book in the GUI, but it only enchants it to level 1 and when I click it again it doesn't do anything.
Here's the skript:
variables:
{_eff} = 1
on right click:
player is holding a diamond pickaxe:
open virtual chest with 1 row named "Enchanting" to player
format gui slot 0 of player with enchanted book named "&eEfficiency" to run:
enchant player's tool with "efficiency %{_eff}%" parsed as enchantment type
set {_eff} to {_eff} + 1
I also tried this but it didn't work either:
variables:
{_eff} = 1
on right click:
player is holding a diamond pickaxe:
open virtual chest with 1 row named "Enchanting" to player
format gui slot 0 of player with enchanted book named "&eEfficiency" to run:
enchant player's tool with "efficiency %{_eff}%" parsed as enchantment type
add 1 to {_eff}