Started by
TheDuckKnight_Mc
on
Topic category: Help with Minecraft 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!
simple answer is some triggers are activated twice because they are done both on client and on server.
the only fix i know of for now is in the procedure at the top put an if statement and put all the other procedures under it and have it do this.
if get number of items in mainhand < 2
do
"code here"
That might work well for what I had in mind, thanks!