"Item is destoyed" Global Trigger not activating for Armor

Started by Catz on

Topic category: Help with modding (Java Edition)

Last seen on 23:51, 8. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"Item is destoyed" Global Trigger not activating for Armor

Title of the post. I'm trying to make it so that when an armor item gets destroyed (from any mod, not just Vanilla) one of my mod's items will attempt to fill the armor slot the destroyed armor previously was in.

Last seen on 23:51, 8. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also using MCreator 2022.2…
Sat, 09/07/2024 - 00:15

Also using MCreator 2022.2 version because future versions dropped 1.18.2 support.

No, I am not downloading a newer MCreator version until it gets 1.18 support. 1.19/1.20 chat reporting can stick it.

This version likely has many…
Sat, 09/07/2024 - 09:43

This version likely has many bugs including this one that were fixed in later versions. I would advise updating and using newer Minecraft version

Last seen on 23:51, 8. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Still broken in 2023.3 …
Sat, 09/07/2024 - 21:39

Still broken in 2023.3 (using community plugin to run MC 1.18.2 on this version)

Does anyone in the community have a workaround?

Last seen on 23:51, 8. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait hold up, this might be…
Sat, 09/07/2024 - 21:46

Wait hold up, this might be an issue with Minecraft Forge itself rather than anything specific to MCreator. Just took at look at the Forge PlayerDestroyItemEvent class which is what triggers the "Item is destroyed" global trigger. A comment states that one of the event's properties "may be null if [the] player destroys the item by any use besides holding it"

So since armor doesn't get destroyed while in the player's hand, instead being destroyed in an armor slot, it probably doesn't get detected for that reason. Gonna repost this issue on Forge's forums, maybe someone has a workaround to this.