Uses of Class
net.neoforged.neoforge.event.entity.living.MobSpawnEvent
Packages that use MobSpawnEvent
-
Uses of MobSpawnEvent in net.neoforged.neoforge.event.entity.living
Subclasses of MobSpawnEvent in net.neoforged.neoforge.event.entity.livingModifier and TypeClassDescriptionclass
This event is fired beforeMob.finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.DifficultyInstance, net.minecraft.world.entity.MobSpawnType, net.minecraft.world.entity.SpawnGroupData)
is called.
This allows mods to control mob initialization.
In vanilla code, this event is injected by a transformer and not via patch, so calls cannot be traced via call hierarchy (it is not source-visible).class
This event is fired fromMob.checkDespawn()
.
It fires once per tick per mob that is attempting to despawn.static class
This event is fired when a mob checks for a valid spawn position, afterSpawnPlacements.checkSpawnRules(net.minecraft.world.entity.EntityType<T>, net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.entity.MobSpawnType, net.minecraft.core.BlockPos, net.minecraft.util.RandomSource)
has been evaluated.
Conditions validated here include the following: Obstruction - mobs inside blocks or fluids. Pathfinding - if the spawn block is valid for pathfinding. Sea Level - Ocelots check if the position is above sea level. Spawn Block - Ocelots check if the below block is grass or leaves.