Re-supplying item problem.

Started by TheDuckKnight_Mc on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Re-supplying item problem.

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!

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
simple answer is some…
Mon, 11/23/2020 - 08:53

simple answer is some triggers are activated twice because they are done both on client and on server.

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the only fix i know of for…
Mon, 11/23/2020 - 09:16

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"

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That might work well for…
Mon, 11/23/2020 - 10:13

That might work well for what I had in mind, thanks!