Class Entities

java.lang.Object
com.welcome234.pluginsystem.entity.Entities

public class Entities extends Object
This class is used for managing entities
  • Method Summary

    Modifier and Type
    Method
    Description
    getAliveEntities​(boolean endDimension)
    Gets all loaded entities are that alive in the specified dimension
    static Entity
    getEntity​(int entityID)
    Gets an entity with the entity identifier specified
    static int
    getEntityCount​(boolean endDimension)
    Gets the number of loaded entities are that alive in the specified dimension
    static int
    Deprecated.
    Entity limits were removed in 1.13.3, this now returns the maximum integer value
    static boolean
    isEntityLimitReached​(boolean endDimension)
    Deprecated.
    Entity limits were removed in 1.13.3, this now always returns true (not reached)
    static Entity
    spawnEntity​(double x, double y, boolean endDimension, EntityTypes entity)
    Spawns a new entity with the specified position and type

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getAliveEntities

      public static ArrayList<Entity> getAliveEntities(boolean endDimension)
      Gets all loaded entities are that alive in the specified dimension
      Parameters:
      endDimension - Dimension (false = Overworld, true = End)
      Returns:
      Array list of loaded entities
    • getEntityCount

      public static int getEntityCount(boolean endDimension)
      Gets the number of loaded entities are that alive in the specified dimension
      Parameters:
      endDimension - Dimension (false = Overworld, true = End)
      Returns:
      Number of loaded entities
    • getEntityLimit

      @Deprecated public static int getEntityLimit()
      Deprecated.
      Entity limits were removed in 1.13.3, this now returns the maximum integer value
      Gets the maximum number of entities that can exist in each dimension

      Both dimensions have the same entity limit

      Returns:
      Entity limit
    • isEntityLimitReached

      @Deprecated public static boolean isEntityLimitReached(boolean endDimension)
      Deprecated.
      Entity limits were removed in 1.13.3, this now always returns true (not reached)
      Gets whether the entity limit is not reached in the specified dimension
      Parameters:
      endDimension - Dimension (false = Overworld, true = End)
      Returns:
      Whether not reached
    • getEntity

      public static Entity getEntity(int entityID)
      Gets an entity with the entity identifier specified
      Parameters:
      entityID - Unique entity ID
      Returns:
      Entity instance
    • spawnEntity

      public static Entity spawnEntity(double x, double y, boolean endDimension, EntityTypes entity)
      Spawns a new entity with the specified position and type

      If the chunk containing the entity is not loaded, it will be automatically loaded when calling this.

      Parameters:
      x - X-coordinate of this entity
      y - Y-coordinate of this entity
      endDimension - Dimension to spawn this entity
      entity - Type of entity to spawn
      Returns:
      Entity instance of the spawned entity
      Throws:
      IllegalArgumentException - if entity is null