Class LivingSpawnEvent.SpecialSpawn
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.EntityEvent
-
- net.minecraftforge.event.entity.living.LivingEvent
-
- net.minecraftforge.event.entity.living.LivingSpawnEvent
-
- net.minecraftforge.event.entity.living.LivingSpawnEvent.SpecialSpawn
-
- Enclosing class:
- LivingSpawnEvent
public static class LivingSpawnEvent.SpecialSpawn extends LivingSpawnEvent
SpecialSpawn is fired when an Entity is to be spawned.
This allows you to do special inializers in the new entity.
This event is fired via theForgeEventFactory#doSpecialSpawn(EntityLiving, World, float, float, float)
.
This event isCancelable
.
If this event is canceled, the Entity is not spawned.
This event does not have a result.Event.HasResult
This event is fired on theMinecraftForge.EVENT_BUS
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingSpawnEvent
LivingSpawnEvent.AllowDespawn, LivingSpawnEvent.CheckSpawn, LivingSpawnEvent.SpecialSpawn
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractSpawner
spawner
private SpawnReason
spawnReason
-
Constructor Summary
Constructors Constructor Description SpecialSpawn(MobEntity entity, World world, double x, double y, double z, AbstractSpawner spawner, SpawnReason spawnReason)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractSpawner
getSpawner()
SpawnReason
getSpawnReason()
-
Methods inherited from class net.minecraftforge.event.entity.living.LivingSpawnEvent
getWorld, getX, getY, getZ
-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
spawner
@Nullable private final AbstractSpawner spawner
-
spawnReason
private final SpawnReason spawnReason
-
-
Constructor Detail
-
SpecialSpawn
public SpecialSpawn(MobEntity entity, World world, double x, double y, double z, @Nullable AbstractSpawner spawner, SpawnReason spawnReason)
- Parameters:
spawner
- the position of a tileentity or approximate position of an entity that initiated the spawn if any
-
-
Method Detail
-
getSpawner
@Nullable public AbstractSpawner getSpawner()
-
getSpawnReason
public SpawnReason getSpawnReason()
-
-