Fire EntityInteractSpecific on server side. Closes #9984

This commit is contained in:
LexManos committed 2024-06-03 12:33:53 -07:00
1 parent f22894cf70
commit 7ee4a44c75
2 files changed
+16

No files matched your search

@@ -255,6 +255,13 @@ public final class ForgeHooks {
return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.getAmount());
}
public static InteractionResult onInteractEntityAt(Entity entity, Player player, Vec3 vec3d, InteractionHand hand) {
var ret = ForgeEventFactory.onEntityInteractSpecific(player, entity, hand, vec3d);
if (ret.isCanceled())
return ret.getCancellationResult();
return entity.interactAt(player, vec3d, hand);
}
public static int getLootingLevel(Entity target, @Nullable Entity killer, @Nullable DamageSource cause) {
int looting = 0;
if (killer instanceof LivingEntity living)