SkBee Item NBT

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Le4ft

Member
Jun 26, 2023
18
0
1
19
Hi,
I need help with SkBee NBT system. I'm trying to do enchantments through NBTs and I'm struggling to find a solution.

This is the NBT compound on my item:
1715594071320.png

How can I make a check for "if player's tool has nbt billionaire1:1b"? I've tried to do
code_language.skript:
if nbt compound of player's tool has nbt tag "billionaire1;1b":
but it doesn't work.

And my next question is, how can I add multiple values into the enchants compound, because I want to add 3 enchantments into that (for example: billionaire1:1b, lifesteal3:1b etc.)

Thanks for any reply!
 
I would do
Sass:
set int tag "Billionair" of {_n} to (level of enchant)
set {_lvl} to int tag "Billionair" of {_n}
 
I would do
Sass:
set int tag "Billionair" of {_n} to (level of enchant)
set {_lvl} to int tag "Billionair" of {_n}
I've already tried this but I'm trying to do it in one nbt tag, because I don't want the same enchant on the item twice and when you have that in one tag it's easier to check if the item has the enchant and you don't have to do x amount of checks

I want to have the nbt tag like this: enchants:"billionaire3":1b,"lifesteal3":1b,"executioner3":1b, but I'm struggling to find the solution for that
 
try something along the lines of this
AppleScript:
on right click:
    set {_n} to nbt compound of player's tool
    set compound list tag "Enchants" of {_n} to "Billionair1", "otherenchant", and "otherenchant2"
    if compound list tag "Enchants" of {_n} contains "Billionair1":
        send "hi" to player