Target block 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.

snakercz_

Member
Jun 5, 2017
13
0
1
Skript Version (do not put latest): Skript 2.5.3
Skript Author: Bensku
Minecraft Version: 1.16.5
Addons: skDragon, Skellett, SkQuery, skRayFall, skUtilities, SharpSK

So basically, I have this problem. I want to check if target block of player is specific head, and if it is, change it to different head. I have solved how to place the specific head, but I can't get it to recognize the NBT data of target block. It just works on any placed player head. Any help would be appreciated!


Code:
on chat:
    if player's tool is blaze rod:
        if message is "Watela" or "Watela!":
            if {xyz.spell.Watela.learntime.%player%} is more than 5:
                if target block is {xyz.spell.Watela.item}: # <--- this is what does not work. the variable is set to specific head. but it works on any playerhead item.
                    send "&7&oSomething happened with the item..."
                    set {_x} to rounded down x-coords of target block
                    set {_y} to rounded down y-coords of target block
                    set {_z} to rounded down z-coords of target block
                    set target block to air
                    execute console command "setblock %{_x}% %{_y}% %{_z}% minecraft:player_head[rotation=0]{SkullOwner:{Id:""bdb8ba17-0fbf-433c-88d8-6dbd4129ae3c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTRiOTNmNDE1MzJmYzI3ZWY3ZGY5MzNjMTgxYWMzMTY2ZDU2MDM3ZDVjNWZmNzVkMmU4NWFmZTM3Y2EyNTdkMyJ9fX0=""}]}}} replace"
            if {xyz.spell.Watela.learntime.%player%} is 3:
                send "&7&oNothing really happened... try again." to player
            add 1 to {xyz.spell.Watela.learntime.%player%}
 
Status
Not open for further replies.