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
This event is fired whenever a
Mob
should do something spawn-related.
This event is not cancellable and does not have a result.
This event is fired on the main Forge event bus only on the logical server.
-
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 before aMob
spawns.static class
This event is fired whenever aMob
is set to be spawned, to allow for mod-specific initializers.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
-