Solved NBT Tag not working (skbee)

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

pepper82

Member
Jan 26, 2017
272
1
18
41
Hi there,
what could be the issue with this script? It does not return the set nbt tag. using latest skbee and latest skript version on 1.17.1

Code:
command /testnbt [<text>] [<text>] [<text>] [<text>] [<text>]:
    trigger:
        set {_tool} to stone sword named "&2Test"
        set {_nbt} to nbt compound of {_tool}
        set tag "crit" of {_nbt} to "100"
        give {_tool} to player
      
on leftclick:
    set {_nbt} to nbt compound of player's tool
    set {_critchance} to tag "crit" of {_nbt}
    broadcast "%{_critchance}%!"

Result:

https://i.imgur.com/G8Vuge1.png
 
Hi there,
what could be the issue with this script? It does not return the set nbt tag. using latest skbee and latest skript version on 1.17.1

Code:
command /testnbt [<text>] [<text>] [<text>] [<text>] [<text>]:
    trigger:
        set {_tool} to stone sword named "&2Test"
        set {_nbt} to nbt compound of {_tool}
        set tag "crit" of {_nbt} to "100"
        give {_tool} to player
     
on leftclick:
    set {_nbt} to nbt compound of player's tool
    set {_critchance} to tag "crit" of {_nbt}
    broadcast "%{_critchance}%!"

Result:

https://i.imgur.com/G8Vuge1.png

Idk, but I know you should set it to a number, and not text. 100, not "100".
 
I think I found the solution:

Code:
set tag "tag;custom;crit" of {_nbt} to "100"

It's not mentioned in the skbee wiki, but that way it seems to work
 
Status
Not open for further replies.