The intended functionality is a player Shift+right clicks the item, it starts storing nbt data just to that item, then they stop storing by clicking again. Then, as long as they have over 0 in charge (nbt value), they can click while not sneaking to use charge. When a player is storing charge, that player should get slowness and when they are using charge, that player should get speed.
so I'm trying to create an Item where you sneak+right click to charge it (to gives slowness), then you can use that charge to give movement speed.
Everything works except the NBT data is not unique. In other words, if I'm storing on one item, it stores on every item that has the NBT tag.
here is the code for the class.
any suggestions?
The intended functionality is a player Shift+right clicks the item, it starts storing nbt data just to that item, then they stop storing by clicking again. Then, as long as they have over 0 in charge (nbt value), they can click while not sneaking to use charge. When a player is storing charge, that player should get slowness and when they are using charge, that player should get speed.
EDIT: solved