• Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Jan 22, 2020
4
0
0
18
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:
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:
I just figured something out.

You could do something like this:

Code:
on enchant:
   chance of 90%:
      wait 1 tick
      set {_item} to slot 0 of player's current inventory
      add "&cTest" to lore of {_item}
      set slot 0 of player's current inventory to {_item}

And you could add "enchant {_item} with xyz" if you want to
 
Last edited:
Status
Not open for further replies.