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.StringgetCardinalDirection(org.bukkit.entity.Entity entity)Get the cardinal compass direction of an entity.static java.lang.StringgetCreatureNameList(boolean requireSpawnable)Get a list of creature names.static org.bukkit.entity.EntityTypematchCreatureType(org.bukkit.command.CommandSender sender, java.lang.String filter, boolean requireSpawnable)Attempts to match a creature type.static <T extends org.bukkit.entity.Projectile>
TsendProjectileFromEntity(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.
-
Constructor Details
-
EntityUtil
public EntityUtil()
-
-
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.CommandExceptionAttempts to match a creature type.- Parameters:
sender- The sender requesting a creature type match. Can be null.filter- The filter string for the matchrequireSpawnable- 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:
-