#Custom item attributes
1 messages · Page 1 of 1 (latest)
hi
so if you want to do luck damage strength or even speed
i think a custom variable for each player is better
on items i think nbt tags is the best way to store data
im not sure about that tho bc i havent looked it alot yet
The problem with NBT tags is I would end up having to have one for every stat on an item
and I can't store the operation
(walking speed i think)
wait
if u mean that u have many tags i think you could store everything in 1 tag
still not sure
I need to store an operation and a value like the vanilla attribute system since I might want to do +15 health, +25% health or 2x health
i think if you could make a custom itemstack or sth and put the values there it would be better
would that require using nms?
depends on how proffesional and good you want it to be
you can do either vanilla variables or nbt tags
and there are apis for nbt tags
so ig u can use them
I was trying to make a custom PDC data type
i think you need to edit the bukkit code for it tho bc from what i know you cant extend a class to itemstack
wait why wouldnt this work?
wdym by pdf
you can store them instead of health as healthMultiplier or such and you can calculate them at the end
after you calculated the other values that are just numbers
for example you loop through the inventory and calculate the total damage number the player will deal then gather all damageMultiplier, add them and do damage * damageMultiplier
also xpdz do you know if theres any way to put variables on an item without nbt tags
by nbt tag I mean PDC
alright thanks XD I didn't think of that
the best I can think of is an NBT tag that just holds an UUID and you create an item manager class to map the UUID to actual stats but apart from that I'm not aware of any sorry
wait itemstacks have uuids?
also i found this @scenic aurora https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
idk exactly what it is i may go check itater
later
No lol I was saying you could give them a UUID through NBT
if im not mistaken Hypixel Skyblock also gives items UUIDs
Yeah this is what I was talking about but I never considered using the key to store more information
ohh
but then they cant be stacked
That's a good point
Hmm. I probably wouldn't be stacking items that give you stat modifiers anyway so that might work