Class EntityUtils

java.lang.Object
ch.njol.skript.bukkitutil.EntityUtils

@Deprecated(since="2.17", forRemoval=true) public class EntityUtils extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use EntityUtils instead.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getAge(org.bukkit.entity.Entity entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the age of an ageable entity.
    static boolean
    isAdult(org.bukkit.entity.Entity entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Quick method to check if entity is an adult.
    static boolean
    isAgeable(org.bukkit.entity.Entity entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check if an entity is ageable.
    static void
    setAdult(org.bukkit.entity.Entity entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Quick method for making an entity an adult.
    static void
    setAge(org.bukkit.entity.Entity entity, int age)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the age of an entity.
    static void
    setBaby(org.bukkit.entity.Entity entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Quick method for making an entity a baby.
    static org.bukkit.entity.EntityType
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convert from Skript's EntityData to Bukkit's EntityType
    static @Nullable org.bukkit.entity.EntityType
    toBukkitEntityType(Class<? extends org.bukkit.entity.Entity> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Attempts to get an EntityType from a Class extending Entity.
    static EntityData<?>
    toSkriptEntityData(org.bukkit.entity.EntityType entityType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convert from Bukkit's EntityType to Skript's EntityData

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityUtils

      public EntityUtils()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • isAgeable

      public static boolean isAgeable(org.bukkit.entity.Entity entity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check if an entity is ageable. Some entities, such as zombies, do not have an age but can be a baby/adult.
      Parameters:
      entity - Entity to check
      Returns:
      True if entity is ageable
    • getAge

      public static int getAge(org.bukkit.entity.Entity entity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the age of an ageable entity. Entities such as zombies do not have an age, this will return -1 if baby, 0 if adult.
      Parameters:
      entity - Entity to grab age for
      Returns:
      Age of entity (if zombie/piglin/zoglin -1 = baby, 0 = adult) (if not ageable, will return 0)
    • setAge

      public static void setAge(org.bukkit.entity.Entity entity, int age)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the age of an entity. Entities such as zombies do not have an age, setting below 0 will make them a baby otherwise adult.
      Parameters:
      entity - Entity to set age for
      age - Age to set
    • setBaby

      public static void setBaby(org.bukkit.entity.Entity entity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Quick method for making an entity a baby. Ageable entities (such as sheep or pigs) will set their default baby age to -24000.
      Parameters:
      entity - Entity to make baby
    • setAdult

      public static void setAdult(org.bukkit.entity.Entity entity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Quick method for making an entity an adult.
      Parameters:
      entity - Entity to make adult
    • isAdult

      public static boolean isAdult(org.bukkit.entity.Entity entity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Quick method to check if entity is an adult.
      Parameters:
      entity - Entity to check
      Returns:
      True if entity is an adult
    • toBukkitEntityType

      public static org.bukkit.entity.EntityType toBukkitEntityType(EntityData<?> entityData)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convert from Skript's EntityData to Bukkit's EntityType
      Parameters:
      entityData - Skript's EntityData
      Returns:
      Bukkit's EntityType
    • toBukkitEntityType

      @Nullable public static @Nullable org.bukkit.entity.EntityType toBukkitEntityType(Class<? extends org.bukkit.entity.Entity> entityClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Attempts to get an EntityType from a Class extending Entity. Ensures at least one EntityType can represent an entity class through Class.isAssignableFrom(Class).
      Parameters:
      entityClass - The Class extending Entity
      Returns:
      The exact or assignable EntityType or null
    • toSkriptEntityData

      public static EntityData<?> toSkriptEntityData(org.bukkit.entity.EntityType entityType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convert from Bukkit's EntityType to Skript's EntityData
      Parameters:
      entityType - Bukkit's EntityType
      Returns:
      Skript's EntityData