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:
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.
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
What can I do to make the item unbreakable.
Last edited: