#why can't i grab the nbt tag from an item?
1 messages · Page 1 of 1 (latest)
its required, wont let u set it without it and also returns the same <none> if u try it without them
and sure
{@eitem} is just event-item
{@editfishinv2} is the inventory name. that part imo is irrelevant bc the event works fine its just the tag
Show me where you set the NBT
It's not required, does that option have the tag?
why do you even have an option instead of just using event-slot anyways?
im too lazy to type it out so i do that until im finished then i replace it, i know its weird but its my process
no, and i get errors when i dont use them but il ltry again
set slot (loop-value+9) of {@pci} to {%{_cni}%} named "%{commoncolor}%%{%{_cnn}%}%" with lore "&7&o%{%{_cnl}%}%%nl%%{commonlabel}%" with {@gnbt} with custom nbt from "{fishskript.editselected:%loop-value%}"
right but you're grabbing the NBT from an option, one which you never gave NBT, did you expect it to return something??
no im not grabbing the nbt from an option. im grabbing it from the event-item. the option is set to event-item
the option is not the item itself
??
you have options: eitem: event-item?
why
this is why i use it
even changing it to event-item yields the same result
this is what happens when u dont use the {}
not when you set the NBT compound, when you get the tag
alternatively just use one method for both setting and getting to simplify things:
#setting
set {_NBT} to custom NBT compound of {_yourItem}
set int tag "example" of {_NBT} to 12345
#getting
set {_NBT} to custom NBT compound of player's tool #or event-item or whatever
set {_value} to int tag "example" of {_NBT}
broadcast {_value}```
still yields none even if i use the {} when setting but not checking
show the code please
this is what ive used in the past, maybe try it
not your latest attempts though
else if {_rows} is between 2.01 and 3:
set {_rn1} to ({_rows}+3)
open chest inventory with {_rn1} rows named {@editfishinv2} to {_p}
set slot {@5guiborder} of {@pci} to {@itemgui} with {@gnbt}
set slot (17+(9*{_rows})) of {@pci} to {@backitem} with {@gnbt}
loop {definedcommons} times:
set {_cni} to "common%loop-value%item"
set {_cnn} to "common%loop-value%"
set {_cnl} to "common%loop-value%lore"
if loop-value is 1 or 2 or 3 or 4 or 5 or 6 or 7:
set slot (loop-value+9) of {@pci} to {%{_cni}%} named "%{commoncolor}%%{%{_cnn}%}%" with lore "&7&o%{%{_cnl}%}%%nl%%{commonlabel}%" with {@gnbt} with custom nbt from "{fishskript.editselected:%loop-value%}"
if (loop-value) is 8,9,10,11,12,13 or 14:
set slot (loop-value+11) of {@pci} to {%{_cni}%} named "%{commoncolor}%%{%{_cnn}%}%" with lore "&7&o%{%{_cnl}%}%%nl%%{commonlabel}%" with {@gnbt} with custom nbt from "{fishskript.editselected:%loop-value%}"
if (loop-value) is 15,16,17,18,19,20 or 21:
set slot (loop-value+13) of {@pci} to {%{_cni}%} named "%{commoncolor}%%{%{_cnn}%}%" with lore "&7&o%{%{_cnl}%}%%nl%%{commonlabel}%" with {@gnbt} with custom nbt from "{fishskript.editselected:%loop-value%}"```
set {_nbttag} to custom nbt compound of event-item
set {_selected} to byte tag "minecraft:custom_data;fishskript.editselected" of {_nbttag}
send "%{_selected}%" to player```
still returns none
you have an option for player's current inventory? Just use a local variable for the GUI:
set slot 14 of {_GUI} to potato
open {_GUI} to player```
i just dont understand why the nbt stuff isnt working