#why can't i grab the nbt tag from an item?

1 messages · Page 1 of 1 (latest)

kind hound
#
  1. Would be nice to see what exactly the option here is
  2. Why do you have {} in the tag name?
frank nacelle
#

{@eitem} is just event-item
{@editfishinv2} is the inventory name. that part imo is irrelevant bc the event works fine its just the tag

kind hound
#

Show me where you set the NBT

mortal flax
kind hound
#

why do you even have an option instead of just using event-slot anyways?

frank nacelle
frank nacelle
frank nacelle
# kind hound Show me where you set the NBT

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%}"

mortal flax
#

right but you're grabbing the NBT from an option, one which you never gave NBT, did you expect it to return something??

kind hound
#

yeah the tag name is "fishskript.editselected" then

#

no {} around it.

frank nacelle
#

the option is not the item itself

mortal flax
#

??

kind hound
#

why

mortal flax
#

at that point just use event-item

#

not everything needs to be an option

frank nacelle
#

even changing it to event-item yields the same result

frank nacelle
kind hound
#

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}```
frank nacelle
#

still yields none even if i use the {} when setting but not checking

kind hound
#

show the code please

kind hound
frank nacelle
#

ive kinda already sent all the relevant code

#

ill try that bit

kind hound
frank nacelle
#
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```
frank nacelle
kind hound
#

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```
frank nacelle
#

im not even worried about the options

#

they are temporary'

frank nacelle