Topic category: Help with Minecraft modding (Java Edition)
so my problem is the following, i wanted to create a crossbow like the vanilla one, so i created an item with a procedure that when you right-click it replaces itself with a version with a new texture to make the illusion of animation then o the final one if you right-click again it will shoot an arrow via the procedure and replace itself again with a unload version and it works great and looks just like a vanilla crossbow,(i made a 3d to make it center on the screen like the vanilla one) but I also wanted to make that every time you fire an arrow it deal one damage to the item and so consumes 1 durability and it would work but as I'm replacing a crossbow for another item to create animation effect the health of the old item is also replaced so I can't make it to both have animation and changing/store loaded effect and keep the item durability every time it replaces itself, so how could I make a health value that is keeping throughout all the replacing and firing process?
I think theres a get durability block so if you made a varible put the durability into a varible, then put the varible on a deal x damage to item that would work
This is possible within the same procedure, but is it possible across multiple procedures? For example:
Assume a ranged item like a spear
How does one make it so that, assuming that and item spawns where it landed once the spear hits a mob / player / block, the item that spawns after hitting something, it has the same durability of the item you threw, minus 1? I am pretty sure this would require at least 2 procedures and some way to store the durability in a variable.
Like the trident currently does, it has full durability, you throw it, pick it up, boom, it has 1 less.
Is that possible inside of mcreator?
This is possible within the same procedure, but is it possible across multiple procedures? For example:
Assume a ranged item like a spear
How does one make it so that, assuming that an item spawns where it landed once the spear hits a mob / player / block, the item that spawns after hitting something, it has the same durability of the item you threw, minus 1? I am pretty sure this would require at least 2 procedures and some way to store the durability in a variable.
Like the trident currently does, it has full durability, you throw it, pick it up, boom, it has 1 less.
Is that possible inside of mcreator?