Topic category: Help with modding (Java Edition)
I tried to make an item that would be useful for building. It has 5 inventory slots and if held in off-hand, it would re-supply the block that was just placed by the player holding it, if there is at least one of that block in the inventory of the item. But thing is, everything somewhat works, but it supplies the player with more than wanted. 1 block is placed, 1 is removed from the item's inventory, but the player gets 2. I'm going to include a picture of the procedure I'm using, so people can help me catch errors and make a new one. If anyone is willing to help, please do so.
Picture of current procedure: https://imgur.com/a/Ld9H7R2
Thanks in advance!