Help with NBT Compounds

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

Jan 9, 2022
8
0
1
Ever since NBT compounds came out, I haven't been able to use NBT in the same way I used to. I'm trying to make what would have previously been a simple script that sets the player head to the specified SkullOwner, but every solution I think of doesn't work. Can you guys give any advice?

Here's the code:
Code:
on break of player wall skull:   
    "%region at event-block%" contains "vineyard1":
        player's held item is not a barrier:
            {grapes::*} doesn't contain location of event-block:
                add location of event-block to {grapes::*}
            
            set {_n::*} to integer tag "SkullOwner" of nbt compound of event-block
            send {_n::*}
            set {_b} to block data of event-block
            
            give player 1 of {items::grape}
            wait 1 seconds
            set block at event-block to player wall skull
            wait 1 tick
            set block data of event-block to {_b}
            set tag "SkullOwner" of nbt compound of event-block to {_n::*}