Solved NBT Error?

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

WiebeHero

Active Member
Aug 23, 2017
135
5
0
23
So i have a helmet with lore and NBT the problem here is it adds the attribute modifiers the lore but not protection 1! Can anyone help me? Thanks!
Code:
give player a unbreakable golden helmet with nbt "{ench:[{id:0,lvl:1}]},{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:10,Operation:0.25,UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "||&7---------------------||&7Armor Defense: 0.20||&7---------------------||&7Upgrade Progress: 0 / 2||&7Rarity: Common"
 
Use Skript's enchantment feature?
code_language.skript:
give player a unbreakable golden helmet of protection 1 with nbt ""
 
Its not the perfect solution, but it works:

code_language.skript:
set {_wanteditem} to unbreakable golden helmet with nbt "{ench:[{id:0,lvl:1}]},{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:10,Operation:0.25,UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "||&7---------------------||&7Armor Defense: 0.20||&7---------------------||&7Upgrade Progress: 0 / 2||&7Rarity: Common"
enchant {_wanteditem} with protection 1
give player {_wanteditem}
[doublepost=1509031925,1509031249][/doublepost]Do you get this error in your console
[17:31:16 WARN]: [Skript] Error when parsing NBT - Encountered multiple top tags, only one expected
 
Hey thanks for the posting! But sadly it doesnt register the armor NBT on the armor points itself wich is key in my server, any other ideas?
 
It works for me always. Please give server/Skript/SkStuff versions (/ver [plugin]) and send your current code.
 
Wow are you kidding me the only THING THE ONLY THING I needed to do was remove the enchantment tag out of the nbt i am such an idiot! XD
Thank you everyone for your help! It was really usefull!
Thanks again and goodbye!
Here is the correct code:
set {_wanteditem} to unbreakable golden helmet with nbt "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:0.45,Operation:0.25,UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "&7---------------------||&7Armor Defense: 0.20||&7---------------------||&7Upgrade Progress: 0 / 2||&7Rarity: Common"
enchant {_wanteditem} with protection 1
give player {_wanteditem}
[doublepost=1509090368,1509090334][/doublepost]
Code:
set {_wanteditem} to unbreakable golden helmet with nbt "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:0.45,Operation:0.25,UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "&7---------------------||&7Armor Defense: 0.20||&7---------------------||&7Upgrade Progress: 0 / 2||&7Rarity: Common"
        enchant {_wanteditem} with protection 1
        give player {_wanteditem}
 
Status
Not open for further replies.