Can't use procedures for items in entity inventory

Started by ShadowPlayer51 on

Topic category: Help with MCreator software

Last seen on 08:50, 26. Mar 2024
Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can't use procedures for items in entity inventory
Fri, 07/23/2021 - 05:08 (edited)

Code

This is the code I've been using to restore 1 durability every 6 seconds on entity tick update. The particles and reset work, but no matter what I do, it will not decrease the damage the item has taken. I've even tried just setting the damage of the item in slot 0 of the entity's inventory but it won't update.

The mob has a single slot inventory that the player cannot take the item out of. Everything else works fine with the item being put in.

The GUI

Edited by ShadowPlayer51 on Fri, 07/23/2021 - 05:08
Last seen on 16:31, 21. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In each time for the loop is…
Fri, 07/23/2021 - 11:24

In each time for the loop is active you have a copy of the item in your local variable, but I think you need to replace the item in the corresponding slot.

I copy your Code and I tried the solution I explained above, and this works.

Try the same, bro.

Code

Last seen on 08:50, 26. Mar 2024
Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tired out your solution…
Fri, 07/23/2021 - 17:58

I tired out your solution and it works now, thank you so much!