Class LivingSpawnEvent
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
- Direct Known Subclasses:
LivingSpawnEvent.AllowDespawn
,LivingSpawnEvent.CheckSpawn
,LivingSpawnEvent.SpecialSpawn
Base class for mob spawn events.
Will not be fired directly.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This event is fired for aMob
that can despawn each mob tick.static class
This event is fired whenMob.checkSpawnRules(net.minecraft.world.level.LevelAccessor, net.minecraft.world.entity.MobSpawnType)
would be called.static class
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLivingSpawnEvent
(Mob mob, LevelAccessor level, double x, double y, double z) -
Method Summary
Modifier and TypeMethodDescriptionReturns the mob that is causing a spawn action.getLevel()
Returns the level relating to the mob spawn action.double
getX()
Returns the x-coordinate relating to the mob spawn action.double
getY()
Returns the y-coordinate relating to the mob spawn action.double
getZ()
Returns the z-coordinate relating to the mob spawn action.Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
level
-
mob
-
x
private final double x -
y
private final double y -
z
private final double z
-
-
Constructor Details
-
LivingSpawnEvent
-
-
Method Details
-
getEntity
Returns the mob that is causing a spawn action.- Overrides:
getEntity
in classLivingEvent
- Returns:
- the mob that is causing a spawn action
-
getLevel
Returns the level relating to the mob spawn action.- Returns:
- the level relating to the mob spawn action
-
getX
public double getX()Returns the x-coordinate relating to the mob spawn action.- Returns:
- the x-coordinate relating to the mob spawn action
-
getY
public double getY()Returns the y-coordinate relating to the mob spawn action.- Returns:
- the y-coordinate relating to the mob spawn action
-
getZ
public double getZ()Returns the z-coordinate relating to the mob spawn action.- Returns:
- the z-coordinate relating to the mob spawn action
-