#can we modify the nbt of a living entity with skbee ?

1 messages · Page 1 of 1 (latest)

dreamy iron
#

thank you i will try

#

I think I'm doing my code wrong because I can't get the nbt customn I'm sending you my code

#
    cancel event
    if block 1 above event-location is air:
        spawn baby zombified piglin at block 1 above event-location
        set tool of last spawned zombified piglin to diamond sword of smite 50
        add nbt compound of "{custom{owner:%player%}}" to nbt compound of last spawned zombified piglin


on right click on zombified piglin:
    cancel event
    set {_nbt} to nbt compound of target entity
    set {_custom} to tag "owner" of {_nbt}
    broadcast "%{_custom}%"
#

the {_custom} variable is in "none"

#

no

#

i also tried with meta tag

#

because I recorded the player who placed the zombie

#

I make a kind of mob that kills other mobs, but the player can modify this mob to improve it

robust sand
#

You can spawn with nbt

#

Why dont you just set the tag of the entity

dreamy iron
#

Because I am unable to do that

robust sand
#

Why

dreamy iron
#

Because I don't know how to do it

robust sand
#

...

#

set tag x of y to z

dreamy iron
#

i try but it didn't succeed

#
On rightclick holding zombified piglin spawn egg:
    cancel event
    if block 1 above event-location is air:
        spawn baby zombified piglin at block 1 above event-location
        set tool of last spawned zombified piglin to diamond sword of smite 50
        set tag "tag;owner" of nbt compound of last spawned zombified piglin to "%player%"

on right click on zombified piglin:
    cancel event
    set {_nbt} to nbt compound of target entity
    set {_custom} to tag "owner" of {_nbt}
    broadcast "%{_custom}%"

it's the same way I use for items and it works for them but there the nbt is none

robust sand
#

Why are you setting the tag of the nbt

#

Just set the tag of the entity

dreamy iron
#

can you give me an example because i don't understand

robust sand
#

set {_p} to tag "owner" of event-entity```
dreamy iron
robust sand
#

Hm

#

metadata tag?

dreamy iron
#

work

#

thank you alot

robust sand
#

Np