Automatically Replace Item NBT, name, and lore

  • 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 community!

    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!

bowmap

Member
Jul 30, 2023
1
0
1
I want to have a script run that automatically replaces every item you pick up with a custom item, by renaming it, changing the lore, and adding nbt data.

The script is currently set to check a players inventory for an item that is not unbreakable (all custom items are unbreakable) and if its a gray dye, set it to unbreakable, but it doesn't work. I don't know how to make it unbreakable, or change the name and lore.

Here's the code:

Code:
command /autofix:
    trigger:
        loop all items in player's inventory:
            loop-value is not unbreakable
            if loop-value is gray dye:
                send "found gray dye"
                # set player's tool to player's tool with nbt "{Unbreakable:1b}"
                #add {Unbreakable:1} to the nbt of loop-value
I have the line making it unbreakable commented out because it doesn't work. Whenever I try to use this, or a similar bit of code, the command doesn't work.
What can I do to make the item unbreakable.
 
Last edited: