#How set an nbt tag to a list using skbee?

1 messages · Page 1 of 1 (latest)

deep pendant
#

custom enchantments are a pain to deal with in this case

#

there are 3 ways to handle them

#

first way:

{tag:{CustomEnchantments:{Spooky:3,Nerd:2}}}``` essentially the tags are named after the enchant and you need to use the condition `%nbtcompounds% has tag %string%`

second way:
```vb
{tag:{CustomEnchantments:["spooky|3","nerd|2","chad|4"]}}``` a string list tag of lists that need to be split at | to get the name (on the left) and the level (on the right)

third way (the one minecraft uses for vanilla enchantments):
```vb
{tag:{CustomEnchantments:[{id:"spooky", lvl:1}, {id:"nerd", lvl:2}]}}```
which is a compound list tag, think of it to something similiar to the first one but there's 2 tags (name and id) and those 2 are stored in 1 compound in a list of compounds
#

lol

#

oh man

#

you need to learn nbt compounds

#

i'll give you a snippet

#

tbh i think it's just the naming skbee uses but maybe there's something more to it

#

can't really tell

#
set {_nbt} to nbt item compound of %item%
set tag "Enchants;NAME" to LEVEL```
#

so look

#

1

#

no ""

#

also please format your code

deep pendant
#

to make this work right you would need something likevb on load: set {enchants::*} to "SussyEnchant", "Magical" and "something"
and when checking the enchantments you need to do vb loop {enchants::*}: add loop-value to {_enchants::*} if {_nbt} has tag "Enchants;%loop-value%"

#

doing this the list _enchants::* will have all the names of the enchants the item has

#

`

#

for the level argument change it to integer

#

and at the end remove the "" and %%

#

if you use text you'll need to parse

#

use integer

#

because it's just "%object%"

#

that's called stringifying

#

ug no

#

👍

#

^

#

outdated

#

wanna learn a magic trick

#

just add compound from after nbt

#

should work for most