#custom item stats

1 messages · Page 1 of 1 (latest)

alpine raft
#

I'm trying to put custom stats on my items, like critical hit chance and luck. The issue is I'm setting the NBT customdata, but when I try to get the values from the NBT string into a variable it doesn't work, and returns <none>. any ideas what i could do?

rapid salmon
#

"please" and "thank you"

alpine raft
#

"please" and "thank you" and I will help 😄

alpine raft
hybrid totem
#

i guess its the nbt season everybody is using nbt

alpine raft
#

set {testnbtsword} to unbreakable wooden sword named "NBT Test" with lore "Damage: 5" with nbt of "{""minecraft:custom_data"":{meleedmg:2}}" with nbt from "{HideFlags:63}"

This is the item I'm testing the NBT with

hybrid totem
#

do you have skbee

alpine raft
#
    trigger:
        set {_item} to player's tool
        set {_testvalnbt} to int tag "CustomData:meleedmg" of custom nbt from {_item}
        send "%{_testvalnbt}% nbt damage" to player
        give player {testnbtsword}```

this is the testing command
alpine raft
#

3.11.1

hybrid totem
#

https://skripthub.net/docs/?id=10694 this may be easier to do it like this

#

it was easier for me

#

oh wait

#

you are doing it

alpine raft
#

i also need to use it for multiple values, like upwards of 10

hybrid totem
#

but only for checking

alpine raft
#

yeah

#

is that the issue?

hybrid totem
#

you can try broadcasting the nbt which you are setting, and the nbt you are checking to see if its the same

#

if its not then you can see what to change

alpine raft
#

if by nbt i'm checking you mean the value that/s the issue, it won't set

#

it returns <none>

hybrid totem
alpine raft
#

i'm just using that item for testing purposes, the command should be able to read the NBT from any item

#

it's not related other than it having an NBT string

hybrid totem
#

you could try setting the nbt tags with the skbee syntax

#

like

#

set int tag "Damage" of nbt of player's tool to 100

alpine raft
#

one moment

hybrid totem
#

dont copy that exact i just got it from docs

alpine raft
#

yeah i changed it

#

variable setting would be the same?

#

or just nbt instead of custom nbt

#

neither worked

#

rip

hybrid totem
#

i will try fix this for you

alpine raft
#

okay thank you

#

is there any possibility that it's a compatibility issue with plugin versions? i have SkBee 3.11.1 and Skript 2.11.0

#

version 1.20.4

hybrid totem
#

alr i think i found the problem

#

instead of doing "Customdata:meleedmg" try "meleedmg"

alpine raft
#

actually ill try both rq

#

worked for the line you suggested, didn't work for the large string

hybrid totem
#

in the command i mean

alpine raft
#

do you know if you could compress multiple of these into one line? i need to do alot of stat reading and don't want to have 500 lines lmao

alpine raft
hybrid totem
#

so it broadcasts the value for you too?

alpine raft
#

it broadcasts when i use the int tag line you suggested, doesn't for the one i was originally using

hybrid totem
#

this is what i used

#
    set {testnbtsword} to unbreakable wooden sword named "NBT Test" with lore "Damage: 5" with nbt of "{""minecraft:custom_data"":{meleedmg:2}}" with nbt from "{HideFlags:63}"

command /nbttest:
    trigger:
        broadcast custom nbt of player's tool
        set {_testvalnbt} to int tag "meleedmg" of custom nbt from player's tool
        send "%{_testvalnbt}% nbt damage" to player```
#

what does hideflags:63 do

alpine raft
#

they get annoying when trying to make item lore

alpine raft
hybrid totem
#

@alpine raft does this work for you

    set {testnbtsword} to unbreakable wooden sword named "NBT Test" with lore "Damage: 5" with all item flags
    set int tag "meleedmg" of custom nbt of {testnbtsword} to 100
    broadcast int tag "meleedmg" of custom nbt of {testnbtsword}


command /nbttest:
    trigger:
        give {testnbtsword} to player
        send int tag "meleedmg" of custom nbt of {testnbtsword} to player```
alpine raft
#

ive been trying to figure that out for like a day lol

hybrid totem
#

does it also hide the flags

#

im on 1.21.4 so its different than 1.20.4

alpine raft
hybrid totem
#

and skript changed the syntax so i dont even know if thats right i just found it

alpine raft
#

works perfectly

hybrid totem
#

alright nice

#

enjoy