Topic category: Help with Minecraft modding (Java Edition)
I tried to solve problem with adding clip mechanics for my firearms in mod. I thought it would be nice to have it as unique NBT tag for tool/item which will save how many ammo gun contains. Tried that with >>Set NBT number tag "Ammo" of provided itemstack<<, but it doesn't work with two different procedures, considering this value separately (I mean, these "NBT number tags" are local, and I'd like one that is bound with an item, not within procedure).
Is it any way for making that unique value which I can "get/set" on different procedures?
Also, second question is about itemstacks. When (back in the days) I wanted to make gun delay after shooting, using it on "provided itemstack" caused weird problem: if I have revolvers in both hands (the same type), they both were "locked".
I thought "provided itemstack" means --this specific item--, but after that "locking" I'm not sure if it's not --item of specific category--. Can someone explain me what kind of instance does "provided itemstack" refers to?
I'm using 2020.3 MCreator if that helps. Thanks in advance <3
itemstack nbt data is not local variable . it is bound to that itemstack and will stay with that itemstack even if you drop it and its picked up by some other player.
"provided itemstack" is the itemstack that was passed to this procedure by the caller.
Thanks for your answer. Not sure if it's thanks to you or not, but I solved all issues, and shooting is now almost perfect <3 also thanks a lot for that information about itemstack not being local - I saw my mistake thanks to this, and also I know now how to use itemstack nbt data better ^^
But is itemstack for example one of the 36 places in your inventory?