#[SOLVED] NBT help

1 messages · Page 1 of 1 (latest)

torn tapir
#
set {_n} to "{explosion:%getlvl(tool, "explosion")%}"
                        set {_last} to nbt compound from {_n}
                        send {_enchants::*}
                        remove {_last} from {_enchants::*}
                        send "%nl% %{_enchants::*}% %nl%"
                        set {_e} to nbt compound from "{explosion:%{_amount}%}"
                        add {_e} to {_enchants::*}
                        set compound list tag "enchants" of nbt compound of player's tool to {_enchants::*}

I have this but it does not remove the nbt from the local var any ideas why?

crystal axle
#

Send whole function(If it's a function)

torn tapir
#

its not a function

#

and thats the part that I need help with

#

other stuff kinda redundant for this problem

stuck saddle
#

Remove tag ... of nbt compound of ...?

torn tapir
#

should be the same thing but I will tryyy

#

dont work

#

this is what it looks like

#

it doesnt take the old nbt away from the list

dense lantern
#

its an array, set a list to the tag, remove what you want from it then set the tag to the list, and try removing it by its index instead of value

torn tapir
#

thats literally what I did

#

its not working

thick wraith
#

you may have to loop
you are setting {_last} to a NEW nbt compound, and trying to remove it from the list that doesn't contain it

just because they may visually LOOK the same, doesn't mean they're the same object

torn tapir
#

ah

#

okay

torn tapir
#

ay ty

#

it works now