Class EntityUtil

java.lang.Object
com.sk89q.commandbook.util.entity.EntityUtil

public class EntityUtil
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    EntityUtil()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String getCardinalDirection​(org.bukkit.entity.Entity entity)
    Get the cardinal compass direction of an entity.
    static java.lang.String getCreatureNameList​(boolean requireSpawnable)
    Get a list of creature names.
    static org.bukkit.entity.EntityType matchCreatureType​(org.bukkit.command.CommandSender sender, java.lang.String filter, boolean requireSpawnable)
    Attempts to match a creature type.
    static <T extends org.bukkit.entity.Projectile>
    T
    sendProjectileFromEntity​(org.bukkit.entity.LivingEntity entity, org.bukkit.util.Vector dir, float speed, java.lang.Class<T> clazz)
    Send a projectile from an entity's eye level.
    static <T extends org.bukkit.entity.Projectile>
    java.util.Set<T>
    sendProjectilesFromEntity​(org.bukkit.entity.LivingEntity entity, int amt, float speed, java.lang.Class<T> clazz)
    Send projectile from an entity's eye level.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • sendProjectileFromEntity

      public static <T extends org.bukkit.entity.Projectile> T sendProjectileFromEntity​(org.bukkit.entity.LivingEntity entity, org.bukkit.util.Vector dir, float speed, java.lang.Class<T> clazz)
      Send a projectile from an entity's eye level.
      Parameters:
      entity -
      dir -
      speed -
      clazz -
    • sendProjectilesFromEntity

      public static <T extends org.bukkit.entity.Projectile> java.util.Set<T> sendProjectilesFromEntity​(org.bukkit.entity.LivingEntity entity, int amt, float speed, java.lang.Class<T> clazz)
      Send projectile from an entity's eye level.
      Parameters:
      entity -
      amt - number of projectiles to shoot (evenly spaced)
      speed -
      clazz -
    • getCardinalDirection

      public static java.lang.String getCardinalDirection​(org.bukkit.entity.Entity entity)
      Get the cardinal compass direction of an entity.
      Parameters:
      entity -
      Returns:
    • matchCreatureType

      public static org.bukkit.entity.EntityType matchCreatureType​(org.bukkit.command.CommandSender sender, java.lang.String filter, boolean requireSpawnable) throws com.sk89q.minecraft.util.commands.CommandException
      Attempts to match a creature type.
      Parameters:
      sender - The sender requesting a creature type match. Can be null.
      filter - The filter string for the match
      requireSpawnable - Whether to only allow EntityTypes that are spawnable
      Returns:
      The matched creature type. Never null.
      Throws:
      com.sk89q.minecraft.util.commands.CommandException - if no CreatureType could be found
    • getCreatureNameList

      public static java.lang.String getCreatureNameList​(boolean requireSpawnable)
      Get a list of creature names.
      Parameters:
      requireSpawnable - Whether to only show entries that are spawnable
      Returns: