Topic category: Help with Minecraft modding (Java Edition)
I have an item that has 10 ''uses" and when a button in a GUI is clicked the item's durability will go down. I have everything set up in a procedure, but the ''on button press" event handler does not have support for itemstacks. The GUI is bound to a block, the item goes in a slot in the GUI. The "itemstack" dependency comes not from actually moddifying the damage, but from detecting the current damage and breaking the item when it reaches -1 (because that is how Minecraft handles it, for some reason, and I want to be consistent). I suspect the problem is that the only procedure block able to detect damage is "get damage of the provided item," so is there a way to define "provided item" without mucking around in the code? If not, could someone tell me how to do the proper code manipulations? (I know JavaScript, but I am nowhere near familiar enough with Java or Minecraft's objects to know what I'm doing)
I have just the same problem, but with crafting... I am making a custom crafting table and want an item to be able to do 5 craftings, then break. But since i can´t just get the damage of any item in the gui i have a little bit of a problem here. Any help would be nice.
Did you found a solution, @SingularityV3?
DeinAlbtraumTV
This should be kind of a workaround for the issue, but it is not a really good way:
https://mcreator.net/forum/47559/tutorial-use-item-durability-when-it-used-crafting-recipes
I actually found another workaround:
I am now using the nbt data of the item to keep track of the remaining uses.