Solved Custom 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 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.

Riknesh

Active Member
Jun 9, 2017
76
2
8
Malaysia
How can I add a custom NBT to a item. I tried following the example in the SkUnity Documentation but didnt work for me. I already have SkStuff installed.

None of these seemed to work. Sad lyf

code_language.skript:
command /debug1:
    trigger:
        give player a stone with custom nbt "{test:10}"          
           
command /debug2:
    trigger:
        give player a stone of Lure 1 with custom nbt "test"

command /debug3:
    trigger:
        give player a stone of Lure 1 with custom nbt "test" named "test stone"

command /debug4:
    trigger:
        give player a stone of Lure 1 with custom nbt "test" named "test stone" with lore "test||stone"
       
command /debug5:
    trigger:
        broadcast "%nbt tags of player's tool%"
 
How can I add a custom NBT to a item. I tried following the example in the SkUnity Documentation but didnt work for me. I already have SkStuff installed.

None of these seemed to work. Sad lyf

code_language.skript:
command /debug1:
    trigger:
        give player a stone with custom nbt "{test:10}"

I tried your first option and it seemed to work
I created a stone with the custom NBT and when checking my player data with NBT Explorer it shows it in my inventory
0VlnypQ.jpg
 
I tried your first option and it seemed to work
I created a stone with the custom NBT and when checking my player data with NBT Explorer it shows it in my inventory
0VlnypQ.jpg
welp the SkStuff plugin that i downloaded from https://docs.skunity.com/downloads/ was actually outdated and didnt support 1.12. that was why it wasnt working for me

I downloaded the newer version from github and it works now.. Thanks Anyway :emoji_slight_smile:
 
yes?!?! I would assume so. You would have to do something like setting a variable (local i think) to the nbt tag of the item, then add the variable as the lore of the item
[doublepost=1525819959,1525819505][/doublepost]you could do something like this

code_language.skript:
command /debug2:
    trigger:
        set {_stone} to stone named "STONE"
        set 1st line of lore of {_stone} to "test:10"
        give player 1 of {_stone} with custom nbt tag "{test:10}"
 
Status
Not open for further replies.