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 have been working with nbt for a while now and i am starting to understand it but 1 thing isnt working very well.
The error is: a types.compound cant be set to anything
Hope you can help me with this!
Code:
set nbt of clicked item to "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10.0,Operation:0,UUIDLeast:324464,UUIDMost:15453,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.6,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}"
 
So i have been working with nbt for a while now and i am starting to understand it but 1 thing isnt working very well.
The error is: a types.compound cant be set to anything
Hope you can help me with this!
Code:
set nbt of clicked item to "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10.0,Operation:0,UUIDLeast:324464,UUIDMost:15453,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.6,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}"

Add "" To nbt of clicked item
 
That is when youre only holding it
[doublepost=1507821475,1507821396][/doublepost]and that picture is blocked
 
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 the event
                set "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10.0,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.6,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" to nbt of clicked item
                set name of clicked item to "&7Stone Club [Lv 2]"
                set the 1st line of lore of clicked item to "&7Confusion II"
                set the 3rd line of lore of clicked item to "&7Attack Damage: 10"
                set the 6th line of lore of clicked item to "&7Upgrade Progress: 0 / 4"
                set cursor of player to air
[doublepost=1507821750,1507821717][/doublepost]There and i dont know what you mean it is trigered by this
[doublepost=1507822366][/doublepost]and it doesnt work sadly
 
Status
Not open for further replies.