Setting NBT

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

Status
Not open for further replies.

WiebeHero

Active Member
Aug 23, 2017
135
5
0
So i am WiebeHero and i want to set NBT on my weapon/tools this is about atribute modifiers.
the error i got is: the NBT of clicked item is neither an item stack nor an entity type!
Hope you can help me with this.
error line: set "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:0.0,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:0,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" of nbt of clicked item
Here is the full code:
Code:
on inventory click:
    if cursor slot of player is stone hoe:
        if lore of cursor slot of player contains "&7Upgrade Progress: 0 / 2":
            if lore of clicked item contains "&7Upgrade Progress: 1 / 2":
                cancel event
                set "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:0.0,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:0,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" of nbt of clicked item
                set cursor of player to air
 
Replace "of" to "to" before nbt. Also replace set to add if it still throws an error.
 
Status
Not open for further replies.