Vanilla item triggers using Item Extensions

Started by BlackCat64 on

Topic category: Feature requests and ideas for MCreator

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Vanilla item triggers using Item Extensions

Hi, it would be great if triggers could be added to existing items using an Item Extension mod element. In my opinion, this mod element has so much untapped potential when it comes to modifying vanilla items.

It would be really useful to detect actions done with an item through a trigger specific to that item, rather than a global trigger which feels like a rather bodged/hacky solution for detecting one specific event.

As an example, this feature would make it easier to detect when the player right-clicks with a vanilla item in either of their hands. Right now, the global trigger "Player right-clicks with item" does not provide an itemstack dependency, which means we don't know if the right-clicked item was in the player's main-hand or off-hand. This means extra logic must be added to detect whether our specific item was right-clicked, by checking both hands. The way I currently do this is by saying: If [item is in main-hand] OR [item is in off-hand AND main-hand is empty]. This logic works for most situations where an item may be used from the off-hand, but I don't think it is 100% foolproof.

I really hope the MCreator team considers expanding the Item Extension element to allow further customization of vanilla items!

bodged/hacky solution for…
Wed, 06/25/2025 - 12:05

bodged/hacky solution for detecting one specific event.

This is exatly how it was intended by Forge. Even if we added this to item extension, same global trigger would still be called.

This is simply how this is designed to work and MCreator uses this standard modding approach of registering events to existing elements