package io.gitlab.jfronny.combit.nodami; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.EventFactory; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.ActionResult; public interface EntityKnockbackCallback { Event EVENT = EventFactory.createArrayBacked(EntityKnockbackCallback.class, (listeners) -> (entity, amp, dx, dz) -> { for (EntityKnockbackCallback event : listeners) { ActionResult result = event.takeKnockback(entity, amp, dx, dz); if (result != ActionResult.PASS) { return result; } } return ActionResult.PASS; }); ActionResult takeKnockback(LivingEntity entity, float amp, double dx, double dz); }