Class MobSpawnEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.MobSpawnEvent
Direct Known Subclasses:
MobSpawnEvent.AllowDespawn, MobSpawnEvent.FinalizeSpawn

public abstract class MobSpawnEvent extends EntityEvent
The subclasses of this event are fired whenever a mob performs a spawning-related action.
  • Field Details

    • level

      private final ServerLevelAccessor level
    • x

      private final double x
    • y

      private final double y
    • z

      private final double z
  • Constructor Details

    • MobSpawnEvent

      @Internal public MobSpawnEvent(Mob mob, ServerLevelAccessor level, double x, double y, double z)
  • Method Details

    • getEntity

      public Mob getEntity()
      Overrides:
      getEntity in class EntityEvent
    • getLevel

      public ServerLevelAccessor getLevel()
      Returns:
      The level relating to the mob spawn action
    • getX

      public double getX()
      Returns:
      The x-coordinate relating to the mob spawn action
    • getY

      public double getY()
      Returns:
      The y-coordinate relating to the mob spawn action
    • getZ

      public double getZ()
      Returns:
      The z-coordinate relating to the mob spawn action