Class LivingSpawnEvent.CheckSpawn
- 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.CheckSpawn
-
- Enclosing class:
- LivingSpawnEvent
public static class LivingSpawnEvent.CheckSpawn extends LivingSpawnEvent
Fires before mob spawn events. Result is significant: DEFAULT: use vanilla spawn rules ALLOW: allow the spawn DENY: deny the spawn
-
-
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 CheckSpawn(MobEntity entity, IWorld world, double x, double y, double z, AbstractSpawner spawner, SpawnReason spawnReason)
CheckSpawn is fired when an Entity is about to be spawned.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractSpawner
getSpawner()
SpawnReason
getSpawnReason()
boolean
isSpawner()
-
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
-
CheckSpawn
public CheckSpawn(MobEntity entity, IWorld world, double x, double y, double z, @Nullable AbstractSpawner spawner, SpawnReason spawnReason)
CheckSpawn is fired when an Entity is about to be spawned.- Parameters:
entity
- the spawning entityworld
- the world to spawn inx
- x coordinatey
- y coordinatez
- z coordinatespawner
- position of the MobSpawner null if it this spawn is coming from a WorldSpawner
-
-
Method Detail
-
isSpawner
public boolean isSpawner()
-
getSpawner
@Nullable public AbstractSpawner getSpawner()
-
getSpawnReason
public SpawnReason getSpawnReason()
-
-