use of net.minecraftforge.event.entity.EntityMobGriefingEvent in project MinecraftForge by MinecraftForge.
the class ForgeEventFactory method getMobGriefingEvent.
public static boolean getMobGriefingEvent(Level world, Entity entity) {
EntityMobGriefingEvent event = new EntityMobGriefingEvent(entity);
MinecraftForge.EVENT_BUS.post(event);
Result result = event.getResult();
return result == Result.DEFAULT ? world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) : result == Result.ALLOW;
}
Aggregations