use of net.minecraftforge.event.entity.living.LivingPackSizeEvent in project MinecraftForge by MinecraftForge.
the class ForgeEventFactory method getMaxSpawnPackSize.
public static int getMaxSpawnPackSize(Mob entity) {
LivingPackSizeEvent maxCanSpawnEvent = new LivingPackSizeEvent(entity);
MinecraftForge.EVENT_BUS.post(maxCanSpawnEvent);
return maxCanSpawnEvent.getResult() == Result.ALLOW ? maxCanSpawnEvent.getMaxPackSize() : entity.getMaxSpawnClusterSize();
}
use of net.minecraftforge.event.entity.living.LivingPackSizeEvent in project MinecraftForge by MinecraftForge.
the class ForgeEventFactory method getMaxSpawnPackSize.
public static int getMaxSpawnPackSize(EntityLiving entity) {
LivingPackSizeEvent maxCanSpawnEvent = new LivingPackSizeEvent(entity);
MinecraftForge.EVENT_BUS.post(maxCanSpawnEvent);
return maxCanSpawnEvent.getResult() == Result.ALLOW ? maxCanSpawnEvent.getMaxPackSize() : entity.getMaxSpawnedInChunk();
}
Aggregations