Class LivingSpawnEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
Direct Known Subclasses:
LivingSpawnEvent.AllowDespawn, LivingSpawnEvent.CheckSpawn, LivingSpawnEvent.SpecialSpawn

public class LivingSpawnEvent extends LivingEvent
This event is fired whenever a Mob should do something spawn-related.

This event is not cancellable and does not have a result.

This event is fired on the main Forge event bus only on the logical server.

  • Field Details

    • level

      private final LevelAccessor level
    • mob

      private final Mob mob
    • x

      private final double x
    • y

      private final double y
    • z

      private final double z
  • Constructor Details

    • LivingSpawnEvent

      public LivingSpawnEvent(Mob mob, LevelAccessor level, double x, double y, double z)
  • Method Details

    • getEntity

      public Mob getEntity()
      Returns the mob that is causing a spawn action.
      Overrides:
      getEntity in class LivingEvent
      Returns:
      the mob that is causing a spawn action
    • getLevel

      public LevelAccessor 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