I'm trying to make a Smelting Touch with Skript, associated with TuSKe. I tried to make the pickaxe have a chance to get the Smelting Touch "Enchantment" (A Lore With Unbreaking 1), and when I try to change the item that got enchanted's Lore, the script prints this problem when reloading it:
The script:
The skript works if I replace every event-item with tool, but I want it to change the item that was enchanted, not the item the player is holding.
Code:
[Server] Server thread/ERROR the lore of event-item stack can't be set to anything (smeltingtouch.sk, line 19: set lore of event-item to "&7Smelting Touch"')
[Server] Server thread/ERROR event-item stack cannot be changed, thus it cannot be (dis)enchanted (smeltingtouch.sk, line 21: enchant event-item with unbreaking 1')
[Server] Server thread/INFO Encountered 2 errors while reloading smeltingtouch.sk!
The script:
Code:
on mine of iron ore:
if player's tool is a pickaxe with lore "&7Smelting Touch":
clear drops
set {drop} to location of target block of player
add 0.5 to y-coordinate of {drop}
drop 1 iron ingot at {drop}
on mine of gold ore:
if player's tool is a pickaxe with lore "&7Smelting Touch":
clear drops
set {drop} to location of target block of player
add 0.5 to y-coordinate of {drop}
drop 1 gold ingot at {drop}
on enchant:
if event-item is a pickaxe:
chance of 10%:
set lore of event-item to "&7Smelting Touch"
if event-item is not enchanted with unbreaking:
enchant event-item with unbreaking 1
The skript works if I replace every event-item with tool, but I want it to change the item that was enchanted, not the item the player is holding.
Last edited: