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
Nested ClassesModifier and TypeClassDescriptionstatic classThis event is fired for aMobthat can despawn each mob tick.static classThis event is fired whenMob.checkSpawnRules(net.minecraft.world.level.LevelAccessor, net.minecraft.world.entity.MobSpawnType)would be called.static classNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
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
ConstructorsConstructorDescriptionLivingSpawnEvent(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.doublegetX()Returns the x-coordinate relating to the mob spawn action.doublegetY()Returns the y-coordinate relating to the mob spawn action.doublegetZ()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:
getEntityin 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
-