Napisałem coś innego, może Ci się spodoba.
command /kula:
permission: admin.kula
trigger:
add 64 fire charge named "&a&lKULA ULEPSZENIA" with lore "&eKliknij nią na przedmiot w ekwipunku, aby go ulepszyć!" and "&f(nie działa na najlepsze enchanty)" to player
on rightclick:
if name of player's tool is "&a&lKULA ULEPSZENIA":
cancel event
on inventory click:
type of cursor slot of player is fire charge
name of cursor slot of player is "&a&lKULA ULEPSZENIA"
if clicked slot is any sword or any armor:
cancel event
if clicked slot is any sword:
if clicked slot is enchanted with sharpness:
set {_lvl} to level of sharpness of clicked slot
if {_lvl} is less than 5:
add 1 to {_lvl}
enchant clicked slot with "sharpness %{_lvl}%" parsed as enchantment type
remove 1 of cursor slot of player from cursor slot of player
send "&aUlepszyłeś %type of clicked slot% na ostrość %{_lvl}%"
play sound "BLOCK_ANVIL_USE" to player
else:
send "&cPrzedmiot posiada maksymalny poziom zakęcia ostrość."
play sound "ITEM_SHIELD_BLOCK" to player
else:
send "&cPrzedmiot nie posiada zaklęcia ostrość!"
play sound "ENTITY_VILLAGER_NO" to player
else:
if clicked slot is any armor:
if clicked slot is enchanted with protection:
set {_lvl} to level of protection of clicked slot
if {_lvl} is less than 4:
add 1 to {_lvl}
enchant clicked slot with "protection %{_lvl}%" parsed as enchantment type
remove 1 of cursor slot of player from cursor slot of player
send "&aUlepszyłeś %type of clicked slot% na ochrona %{_lvl}%"
play sound "BLOCK_ANVIL_USE" to player
else:
send "&cPrzedmiot posiada maksymalny poziom zakęcia ochrona."
play sound "ITEM_SHIELD_BLOCK" to player
else:
send "&cPrzedmiot nie posiada zaklęcia ochrona!"
play sound "ENTITY_VILLAGER_NO" to player