NBT Tag not working

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

MusicManSK

Active Member
Nov 30, 2017
230
11
18
Hello..

Code:
code_language.skript:
on damage:
    if attacker is set:
        if victim is set:
            if world of location of victim is {@Map}:
                if health of victim - damage is less than 0:
                    cancel event
                    spawn 1 skeleton at location of victim
                    add "{Equipment:[{},{},{},{},{id:397}]},CustomNameVisible:1" to nbt of spawned skeleton
                    set name of last spawned skeleton to "&c%name of victim%"
                    set health of spawned skeleton to 5
                    set target of spawned skeleton to attacker
                    wait 1 tick
                    heal victim
                    teleport victim to {kit.lobby}
                    broadcast "&b%victim% &ehas been killed by &b%attacker%" to {@Map}
                    wait 3 seconds
                    kill spawned skeleton

Error:
Not error, but its not working.. everything work well but it wont change NBT of entity.. skeleton has still bow in his hand, .....

What I want?:
Help, plz help

xD
 
Last edited:
Hello..

Code:
code_language.skript:
on damage:
    if attacker is set:
        if victim is set:
            if world of location of victim is {@Map}:
                if health of victim - damage is less than 0:
                    cancel event
                    spawn 1 skeleton at location of victim
                    add "{Equipment:[{},{},{},{},{id:397}]},CustomNameVisible:1" to nbt of spawned skeleton
                    set name of last spawned skeleton to "&c%name of victim%"
                    set health of spawned skeleton to 5
                    set target of spawned skeleton to attacker
                    wait 1 tick
                    heal victim
                    teleport victim to {kit.lobby}
                    broadcast "&b%victim% &ehas been killed by &b%attacker%" to {@Map}
                    wait 3 seconds
                    kill spawned skeleton

Error:
Not error, but its not working.. everything work well but it wont change NBT of entity.. skeleton has still bow in his hand, .....

What I want?:
Help, plz help

xD

you forgot to add "}" at ` add "{Equipment:[{},{},{},{},{id:397}]},CustomNameVisible:1" to nbt of spawned skeleton `
 
no.. i already have it there because i tried every combination.. with and without "{}".. and no.. i have it there and without "{}" will log error in console..
actual code:
code_language.skript:
if world of location of victim is {@Map}:
                if health of victim - damage is less than 0:
                    cancel event
                    spawn 1 skeleton at location of victim
                    add "{Equipment:[{},{},{},{},{id:397}],CustomNameVisible:1}" to nbt of spawned skeleton
                    set name of last spawned skeleton to "&c%name of victim%"
                    add 1 to {kit.kills::%attacker%}
                    add 1 to {kit.deaths::%victim%}
                    set health of spawned skeleton to 5
                    set target of spawned skeleton to attacker
                    wait 1 tick
                    heal victim
                    clear inventory of victim
                    teleport victim to {kit.lobby}
                    wait 3 seconds
                    kill spawned skeleton
[doublepost=1526682127,1526673513][/doublepost]summon commant not working too.. its just write to console "Object successfully summoned" but i can see it.. maybe im blind or it was summoned on another server.. or idk.. why? WHY? im so unlucky.. im makeing big projects, big source codes but it cant run bcs function "wait" not working, function "if" not working.. its broken! everything is broken! every single language! i have no clue how Microsoft done Windows.. they were probably trying to code dishwasher but they made windows or idk.. ..plz help me.. i want to make it..

FIXED:
I made it:
code_language.skript:
add "{CustomNameVisible:1}" to nbt of spawned skeleton
set name of last spawned skeleton to "&c%name of victim%"
set the weapon of spawned skeleton to bone
set helmet of spawned skeleton to "77" parsed as item
 
I must to parse ids as items because skull not working with "skull" soi had to put there ID.. And no.. For me not.. I applied it without changing NBT and name was there but only when looked on him.. Like named horses or dogs in vanilla.. See.. I need to make it so difficult to keep it working..
 
I must to parse ids as items because skull not working with "skull" soi had to put there ID.. And no.. For me not.. I applied it without changing NBT and name was there but only when looked on him.. Like named horses or dogs in vanilla.. See.. I need to make it so difficult to keep it working..
It doesn't work with skull because it is "player head", and if it doesn't you can use the following custom syntax for it:
code_language.skript:
effect:
  patterns:
    make %entities%'[s] [(display|custom)] name [permanently] [(1¦in)]visible
    make [the] [(display|custom)] name of %entities% [(1¦in)]visible
  trigger:

    if parser mark is 1:
      set {_visibility} to false
    else:
      set {_visibility} to true

    loop expressions-1:
      loop-value.setCustomNameVisible({_visibility});
Either way, stay away from NBT.
 
Status
Not open for further replies.