Uses of Class
net.neoforged.neoforge.event.entity.living.MobSpawnEvent

Packages that use MobSpawnEvent
  • Uses of MobSpawnEvent in net.neoforged.neoforge.event.entity.living

    Modifier and Type
    Class
    Description
    class 
    This event is fired before Mob.finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.DifficultyInstance, net.minecraft.world.entity.EntitySpawnReason, 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 from Mob.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, after SpawnPlacements.checkSpawnRules(net.minecraft.world.entity.EntityType<T>, net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.entity.EntitySpawnReason, 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.