Item damage count workaround for breaking item on 0

Started by HollowHeart19 on

Topic category: Troubleshooting, bugs, and solutions

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item damage count workaround for breaking item on 0

I've created an item with durability because of right click on block events. Once item damage count hits "0", I need a way to create an event that breaks the item once this occurs. Suggestions? and don't say tools. Tools focus left clicking. Right clicking events won't effect durability or "uses" for tools.

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if the ItemStack…
Thu, 09/06/2018 - 05:53

Check if the ItemStack durability is less or equal to 0 and then just remove it from inventory.

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know to do that, but the…
Sat, 09/08/2018 - 22:13

I know to do that, but the problem is, the item procedures have no way to make a comparison to check itemstack from the java blocks. Is this something I'll have to add to the events in the code for my item mentioned?

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What MCreator version are…
Sat, 09/08/2018 - 22:31

What MCreator version are you using?
By the way, I really recommend you to just edit the code instead of doing it in procedures/events as the needed code should fit pretty much on one line.

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1.8.0, and even in this…
Sun, 09/09/2018 - 02:41

1.8.0, and even in this instance, I don't know what line of code to add, and where in the file

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It depends on what the…
Sun, 09/09/2018 - 07:34

It depends on what the MCreator generated code looks like. You will have to edit the procedure or the block that calls the procedure.