#NBT
1 messages · Page 1 of 1 (latest)
when {_nbt} is already a compound you can just use {_nbt}
whenever you broadcast a variable, put it as a string like "%{_type}%" so it'll always display
if the variable is unset, it won't send anything
if you set it as a string, it'll send <none> [assuming its not set]
set {_type} to tag "ItemType" of {_nbt}```
I have followed both of your solutions, I as the sender get a message, the message being <none>. I am holding the item. Could this possibly be due to the setting of the NBT?
try just "send nbt compound of player's tool"
idk what {item.key} is
problem might be with that
As I thought, it did not add it.
set tag "ItemType" of nbt compound of {item.key} to "Key" is what is adding it, I looked over every forum and document I can to try to figure out the correct structure and thats how far I got
you want to add a tag right?
Yes
gimme sec
set {_tag} to nbt compound from "{ItemType:whatever}"
add {_tag} to {_nbt}```
try this
I had to modify it due to how the system works;
Basically, I use a command that is only to be used in testing to modify the theororetical item. The item is stored on the server as a variable. I begin with setting the variable to a paper named "Key" and then set item up through that. It then gives the player the created item. There is another command that gets the item type which is supposed to get whatever is on the right side of the ItemType: tag. (whatever being that in your example). There has been no value added and this is what it looks like:
set {_nbt} to nbt compound of {item.key}
set {_tag} to nbt compound from "{ItemType:Key}"
add {_tag} to {_nbt}
trigger:
set {_nbt} to nbt compound of player's tool
set tag "key" of {_nbt} to 1
broadcast "%{_nbt}%"```
does this work?
That goes in the command that outputs the NBT right?
just try if code i sent works
copy paste
reload
/test
see if item you are holding has "key:1"
in nbt
so seems like if you just set tag to value
the tag gets created if it doesnt exist already
so idk why your thing isnt working
maybe because you are doing it through variable
{item.key} thing
How would I retrieve just the word "Key" from the NBT compound, not Key:1 or whatever you are trying to add?
And I cannot set the NBT value in the command that prints the type because that is going to have to print the types for multiple items..
broadcast "%tag "ItemType" of nbt compound of player's tool%"
ItemType is the tag where you want to store stuff if i understand it correctly
<none>
that means you didnt set it before
there is something wrong with the part of code where you are adding the tag
Command that created the item:
give paper named "Key" with nbt compound from "{ItemType:Key}" to player done
It cannot work like that because the name changes depending on the team of the player.
just change the name not whole item
It is setting the name of the item, nothing else changes with that
and it also has to be a variable so it is stored