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 TypeClassDescriptionclassThis event is fired beforeMob.finalizeSpawn(ServerLevelAccessor, DifficultyInstance, EntitySpawnReason, 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).classThis event is fired fromMob.checkDespawn().
It fires once per tick per mob that is attempting to despawn.static classThis event is fired when a mob checks for a valid spawn position, afterSpawnPlacements.checkSpawnRules(EntityType, ServerLevelAccessor, EntitySpawnReason, BlockPos, 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.