#Adding variables to an item

1 messages · Page 1 of 1 (latest)

spice cargo
#

Trying to design a clothes system where players can buy clothes to their customisation (there are about 30 colours so I want to automate this as much as possible).
I don't know if using NBT data would work for this, because I'm connecting another plugin to this system where I have to run the command /clothes wear <player> <clothestype>/<clothesitem>_<clothescolour>, so I need a lot of different variables.
Any ideas?

#

I could theoretically get the data from the item name/lore, but then it's going to look ugly for the player as instead of having an item called "Sky Blue Hoodie" it's going to be called "sky_blue hoodie" which obviously looks less professional.

thorn seal
#

NBT is the best way for this yes

#

Store everything in the item itself

spice cargo
#

can i add nbt tags aside from {thinghere: 1b} because i want to be able to make it more like {thinghere: "texthere"}

thorn seal
#

Yes you can do anything with nbt

spice cargo
#

so i can put anything there and it doesn't have to say "1b"?

thorn seal
#

NBT is fully custom, it can be anything for the tag itself and for the value

spice cargo
#

set {_clothesnbt} to nbt compound from "{custom: {clothestype: %{_clothes_type}%, clothesstyle: %{_clothes_style}%, clothescolour: %{_clothes_colour}%}}"
Would this work?

thorn seal
#

Remove the random spaces

#

You also don't need the tag custom, not sure if you just happen to want that or if you saw the wiki and misunderstood

spice cargo
#

oh idk what custom actually does

#

i've just seen it used before

#

wdym by the random spaces? the spaces after the commas and colons?

thorn seal
spice cargo
spice cargo
# thorn seal Every space

So, like this? set {_clothesnbt} to nbt compound from "{custom:{clothes_type:%{_clothes_type}%,clothes_item:%{_clothes_style}%,clothes_colour:%{_clothes_colour}%}"

thorn seal
#

"{Clothes:{Type:%{_clothes_type}%,Style:%{_clothes_style}%,Colour:%{_clothes_colour}%}"

#

I'd do that

#

And then you can use tag "Clothes;Type" of x

#

Clothes;Style

#

And so on

spice cargo
#

oooooh