====== Events ====== Architectury allows you to subscribe to events in your common project, abstracting platform-specific event API's. ===== Example ===== Subscriptions are performed in a callback style, similar to Fabric. These callbacks can be made right from your common project's init. Here is an example event that will prevent all damage to any LivingEntity: EntityEvent.LIVING_HURT.register((LivingEntity entity, DamageSource source, float amount) -> { return EventResult.interruptFalse(); }); ===== What's next? ===== Given the above example, things should be pretty self-explanatory assuming you're handy in IDEA. If you jump to the ''EntityEvent'' class you will find all Architectury events nearby. You could also browse the source if you don't have a workspace open - [[https://github.com/architectury/architectury-api/tree/1.19.2/common/src/main/java/dev/architectury/event/events|Architecty API Events package on 1.19.2 branch]]. The returned ''EventResult'' in the example will interrupt the event, preventing it from propagating - there are, of course, other possible results that you would expect. Check the [[https://github.com/architectury/architectury-api/blob/1.19.2/common/src/main/java/dev/architectury/event/EventResult.java|JavaDoc for EventResult]] for details.