Wiki 9Minecraft Wiki 9Minecraft
Event Wrapper Wiki › Guides › Handle Living Entity Events Across Platforms

Handle Living Entity Events Across Platforms

Understand Available Living Entity Wrappers

The mod provides wrapper types for common living entity events. These wrappers abstract away loader-specific event details, letting you focus on game logic.

Access Event Data

When your method receives a wrapper event parameter, use its properties to read what happened:

  • The affected entity
  • Values being changed (healing amount, effect details)
  • Whether the event can be cancelled

Implement Your Handler

`java

@SubscriberEventWrapper

public static void onEffect(MobEffectEventWrapper event) {

// Check the entity or effect type

// Modify behavior or cancel if needed

}

`

Each wrapper type exposes the same methods and properties regardless of whether you're running on Forge or Fabric. This consistency means your event logic doesn't need platform checks. Test your handler on both loaders to ensure it behaves as expected.