Search in sources :

Example 1 with LivingPackSizeEvent

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();
}
Also used : LivingPackSizeEvent(net.minecraftforge.event.entity.living.LivingPackSizeEvent)

Example 2 with LivingPackSizeEvent

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();
}
Also used : LivingPackSizeEvent(net.minecraftforge.event.entity.living.LivingPackSizeEvent)

Aggregations

LivingPackSizeEvent (net.minecraftforge.event.entity.living.LivingPackSizeEvent)2