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
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.SpecialSpawnNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.SizeNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCheckSpawn(Mob entity, LevelAccessor world, double x, double y, double z, BaseSpawner spawner, MobSpawnType spawnReason) CheckSpawn is fired when an Entity is about to be spawned. -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethods inherited from class net.minecraftforge.event.entity.living.LivingSpawnEvent
getWorld, getX, getY, getZMethods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLivingMethods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntityMethods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
spawner
-
spawnReason
-
-
Constructor Details
-
CheckSpawn
public CheckSpawn(Mob entity, LevelAccessor world, double x, double y, double z, @Nullable BaseSpawner spawner, MobSpawnType 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 Details
-
isSpawner
public boolean isSpawner() -
getSpawner
-
getSpawnReason
-