Item damage count workaround for breaking item on 0

Started by HollowHeart19 on Thu, 09/06/2018 - 01:50

Topic category: Bugs and solutions

Last seen on 00:20, 19. Sep 2018
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Item damage count workaround for breaking item on 0
Thu, 09/06/2018 - 01:50

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.

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 00:20, 19. Sep 2018
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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?

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 00:20, 19. Sep 2018
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.