Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.entity.HumanEntity Interface Reference

Represents a human entity, such as an NPC or a player. More...

+ Inheritance diagram for org.bukkit.entity.HumanEntity:
+ Collaboration diagram for org.bukkit.entity.HumanEntity:

Public Member Functions

String getName ()
 Returns the name of this player.
 
PlayerInventory getInventory ()
 Get the player's inventory.
 
Inventory getEnderChest ()
 Get the player's EnderChest inventory.
 
boolean setWindowProperty (InventoryView.Property prop, int value)
 If the player currently has an inventory window open, this method will set a property of that window, such as the state of a progress bar.
 
InventoryView getOpenInventory ()
 Gets the inventory view the player is currently viewing.
 
InventoryView openInventory (Inventory inventory)
 Opens an inventory window with the specified inventory on the top and the player's inventory on the bottom.
 
InventoryView openWorkbench (Location location, boolean force)
 Opens an empty workbench inventory window with the player's inventory on the bottom.
 
InventoryView openEnchanting (Location location, boolean force)
 Opens an empty enchanting inventory window with the player's inventory on the bottom.
 
void openInventory (InventoryView inventory)
 Opens an inventory window to the specified inventory view.
 
void closeInventory ()
 Force-closes the currently open inventory view for this player, if any.
 
ItemStack getItemInHand ()
 Returns the ItemStack currently in your hand, can be empty.
 
void setItemInHand (ItemStack item)
 Sets the item to the given ItemStack, this will replace whatever the user was holding.
 
ItemStack getItemOnCursor ()
 Returns the ItemStack currently on your cursor, can be empty.
 
void setItemOnCursor (ItemStack item)
 Sets the item to the given ItemStack, this will replace whatever the user was moving.
 
boolean isSleeping ()
 Returns whether this player is slumbering.
 
int getSleepTicks ()
 Get the sleep ticks of the player.
 
GameMode getGameMode ()
 Gets this humans current GameMode.
 
void setGameMode (GameMode mode)
 Sets this humans current GameMode.
 
boolean isBlocking ()
 Check if the player is currently blocking (ie with a sword).
 
int getExpToLevel ()
 Get the total amount of experience required for the player to level.
 
- Public Member Functions inherited from org.bukkit.entity.LivingEntity
double getEyeHeight ()
 Gets the height of the entity's head above its Location.
 
double getEyeHeight (boolean ignoreSneaking)
 Gets the height of the entity's head above its Location.
 
Location getEyeLocation ()
 Get a Location detailing the current eye position of the LivingEntity.
 
List< BlockgetLineOfSight (HashSet< Byte > transparent, int maxDistance)
 Gets all blocks along the player's line of sight List iterates from player's position to target inclusive.
 
Block getTargetBlock (HashSet< Byte > transparent, int maxDistance)
 Gets the block that the player has targeted.
 
List< BlockgetLastTwoTargetBlocks (HashSet< Byte > transparent, int maxDistance)
 Gets the last two blocks along the player's line of sight.
 
Egg throwEgg ()
 Throws an egg from the entity.
 
Snowball throwSnowball ()
 Throws a snowball from the entity.
 
Arrow shootArrow ()
 Shoots an arrow from the entity.
 
public< T extends Projectile > T launchProjectile (Class<?extends T > projectile)
 Launches a Projectile from the entity.
 
int getRemainingAir ()
 Returns the amount of air that this entity has remaining, in ticks.
 
void setRemainingAir (int ticks)
 Sets the amount of air that this entity has remaining, in ticks.
 
int getMaximumAir ()
 Returns the maximum amount of air this entity can have, in ticks.
 
void setMaximumAir (int ticks)
 Sets the maximum amount of air this entity can have, in ticks.
 
int getMaximumNoDamageTicks ()
 Returns the entities current maximum noDamageTicks This is the time in ticks the entity will become unable to take equal or less damage than the lastDamage.
 
void setMaximumNoDamageTicks (int ticks)
 Sets the entities current maximum noDamageTicks.
 
int getLastDamage ()
 Returns the entities lastDamage taken in the current noDamageTicks time.
 
void setLastDamage (int damage)
 Sets the entities current maximum noDamageTicks.
 
int getNoDamageTicks ()
 Returns the entities current noDamageTicks.
 
void setNoDamageTicks (int ticks)
 Sets the entities current noDamageTicks.
 
Player getKiller ()
 Gets the player identified as the killer of this entity.
 
boolean addPotionEffect (PotionEffect effect)
 Adds the given PotionEffect to this entity.
 
boolean addPotionEffect (PotionEffect effect, boolean force)
 Adds the given PotionEffect to this entity.
 
boolean addPotionEffects (Collection< PotionEffect > effects)
 Attempts to add all of the given PotionEffect to this entity.
 
boolean hasPotionEffect (PotionEffectType type)
 Returns whether the entity already has an existing effect of the given PotionEffectType applied to it.
 
void removePotionEffect (PotionEffectType type)
 Removes any effects present of the given PotionEffectType.
 
Collection< PotionEffectgetActivePotionEffects ()
 Returns all currently active PotionEffects on this entity.
 
boolean hasLineOfSight (Entity other)
 Checks whether the entity has block line of sight to another.
 
boolean getRemoveWhenFarAway ()
 Returns if the entity despawns when away from players or not.
 
void setRemoveWhenFarAway (boolean remove)
 Sets whether or not the entity despawns when away from players or not.
 
EntityEquipment getEquipment ()
 Gets the inventory with the equipment worn by this entity.
 
void setCanPickupItems (boolean pickup)
 Sets whether or not the entity can pick up items.
 
boolean getCanPickupItems ()
 Gets if the entity can pick up items.
 
- Public Member Functions inherited from org.bukkit.entity.Entity
Location getLocation ()
 Gets the entity's current position.
 
Location getLocation (Location loc)
 Stores the entity's current position in the provided Location object.
 
void setVelocity (Vector velocity)
 Sets this entity's velocity.
 
Vector getVelocity ()
 Gets this entity's current velocity.
 
World getWorld ()
 Gets the current world this entity resides in.
 
boolean teleport (Location location)
 Teleports this entity to the given location.
 
boolean teleport (Location location, TeleportCause cause)
 Teleports this entity to the given location.
 
boolean teleport (Entity destination)
 Teleports this entity to the target Entity.
 
boolean teleport (Entity destination, TeleportCause cause)
 Teleports this entity to the target Entity.
 
List< org.bukkit.entity.EntitygetNearbyEntities (double x, double y, double z)
 Returns a list of entities within a bounding box centered around this entity.
 
int getEntityId ()
 Returns a unique id for this entity.
 
int getFireTicks ()
 Returns the entity's current fire ticks (ticks before the entity stops being on fire).
 
int getMaxFireTicks ()
 Returns the entity's maximum fire ticks.
 
void setFireTicks (int ticks)
 Sets the entity's current fire ticks (ticks before the entity stops being on fire).
 
void remove ()
 Mark the entity's removal.
 
boolean isDead ()
 Returns true if this entity has been marked for removal.
 
boolean isValid ()
 Returns false if the entity has died or been despawned for some other reason.
 
Server getServer ()
 Gets the Server that contains this Entity.
 
abstract Entity getPassenger ()
 Gets the primary passenger of a vehicle.
 
abstract boolean setPassenger (Entity passenger)
 Set the passenger of a vehicle.
 
abstract boolean isEmpty ()
 Check if a vehicle has passengers.
 
abstract boolean eject ()
 Eject any passenger.
 
float getFallDistance ()
 Returns the distance this entity has fallen.
 
void setFallDistance (float distance)
 Sets the fall distance for this entity.
 
void setLastDamageCause (EntityDamageEvent event)
 Record the last EntityDamageEvent inflicted on this entity.
 
EntityDamageEvent getLastDamageCause ()
 Retrieve the last EntityDamageEvent inflicted on this entity.
 
UUID getUniqueId ()
 Returns a unique and persistent id for this entity.
 
int getTicksLived ()
 Gets the amount of ticks this entity has lived for.
 
void setTicksLived (int value)
 Sets the amount of ticks this entity has lived for.
 
void playEffect (EntityEffect type)
 Performs the specified EntityEffect for this entity.
 
EntityType getType ()
 Get the type of the entity.
 
boolean isInsideVehicle ()
 Returns whether this entity is inside a vehicle.
 
boolean leaveVehicle ()
 Leave the current vehicle.
 
Entity getVehicle ()
 Get the vehicle that this player is inside.
 
- Public Member Functions inherited from org.bukkit.entity.Damageable
void damage (int amount)
 Deals the given amount of damage to this entity.
 
void damage (int amount, Entity source)
 Deals the given amount of damage to this entity, from a specified entity.
 
int getHealth ()
 Gets the entity's health from 0 to getMaxHealth(), where 0 is dead.
 
void setHealth (int health)
 Sets the entity's health from 0 to getMaxHealth(), where 0 is dead.
 
int getMaxHealth ()
 Gets the maximum health this entity has.
 
void setMaxHealth (int health)
 Sets the maximum health this entity can have.
 
void resetMaxHealth ()
 Resets the max health to the original amount.
 
- Public Member Functions inherited from org.bukkit.entity.AnimalTamer
String getName ()
 This is the name of the specified AnimalTamer.
 
- Public Member Functions inherited from org.bukkit.permissions.Permissible
boolean isPermissionSet (String name)
 Checks if this object contains an override for the specified permission, by fully qualified name.
 
boolean isPermissionSet (Permission perm)
 Checks if this object contains an override for the specified Permission.
 
boolean hasPermission (String name)
 Gets the value of the specified permission, if set.
 
boolean hasPermission (Permission perm)
 Gets the value of the specified permission, if set.
 
PermissionAttachment addAttachment (Plugin plugin, String name, boolean value)
 Adds a new PermissionAttachment with a single permission by name and value.
 
PermissionAttachment addAttachment (Plugin plugin)
 Adds a new empty PermissionAttachment to this object.
 
PermissionAttachment addAttachment (Plugin plugin, String name, boolean value, int ticks)
 Temporarily adds a new PermissionAttachment with a single permission by name and value.
 
PermissionAttachment addAttachment (Plugin plugin, int ticks)
 Temporarily adds a new empty PermissionAttachment to this object.
 
void removeAttachment (PermissionAttachment attachment)
 Removes the given PermissionAttachment from this object.
 
void recalculatePermissions ()
 Recalculates the permissions for this object, if the attachments have changed values.
 
Set< PermissionAttachmentInfogetEffectivePermissions ()
 Gets a set containing all of the permissions currently in effect by this object.
 
- Public Member Functions inherited from org.bukkit.permissions.ServerOperator
boolean isOp ()
 Checks if this object is a server operator.
 
void setOp (boolean value)
 Sets the operator status of this object.
 
- Public Member Functions inherited from org.bukkit.inventory.InventoryHolder
Inventory getInventory ()
 Get the object's inventory.
 

Detailed Description

Represents a human entity, such as an NPC or a player.

Definition at line 15 of file HumanEntity.java.

Member Function Documentation

void org.bukkit.entity.HumanEntity.closeInventory ( )

Force-closes the currently open inventory view for this player, if any.

Referenced by org.bukkit.inventory.InventoryView.close().

Inventory org.bukkit.entity.HumanEntity.getEnderChest ( )

Get the player's EnderChest inventory.

Returns
The EnderChest of the player
int org.bukkit.entity.HumanEntity.getExpToLevel ( )

Get the total amount of experience required for the player to level.

Returns
Experience required to level up
GameMode org.bukkit.entity.HumanEntity.getGameMode ( )

Gets this humans current GameMode.

Returns
Current game mode

Referenced by org.bukkit.command.defaults.GameModeCommand.execute().

PlayerInventory org.bukkit.entity.HumanEntity.getInventory ( )

Get the player's inventory.

Returns
The inventory of the player, this also contains the armor slots.

Referenced by org.bukkit.command.defaults.ClearCommand.execute(), and org.bukkit.command.defaults.GiveCommand.execute().

ItemStack org.bukkit.entity.HumanEntity.getItemInHand ( )

Returns the ItemStack currently in your hand, can be empty.

Returns
The ItemStack of the item you are currently holding.

Referenced by org.bukkit.command.defaults.EnchantCommand.execute().

ItemStack org.bukkit.entity.HumanEntity.getItemOnCursor ( )

Returns the ItemStack currently on your cursor, can be empty.

Will always be empty if the player currently has no open window.

Returns
The ItemStack of the item you are currently moving around.

Referenced by org.bukkit.inventory.InventoryView.getCursor().

InventoryView org.bukkit.entity.HumanEntity.getOpenInventory ( )

Gets the inventory view the player is currently viewing.

If they do not have an inventory window open, it returns their internal crafting view.

Returns
The inventory view.
int org.bukkit.entity.HumanEntity.getSleepTicks ( )

Get the sleep ticks of the player.

This value may be capped.

Returns
slumber ticks
boolean org.bukkit.entity.HumanEntity.isBlocking ( )

Check if the player is currently blocking (ie with a sword).

Returns
Whether they are blocking.
boolean org.bukkit.entity.HumanEntity.isSleeping ( )

Returns whether this player is slumbering.

Returns
slumber state
InventoryView org.bukkit.entity.HumanEntity.openEnchanting ( Location  location,
boolean  force 
)

Opens an empty enchanting inventory window with the player's inventory on the bottom.

Parameters
locationThe location to attach it to. If null, the player's location is used.
forceIf false, and there is no enchanting table at the location, no inventory will be opened and null will be returned.
Returns
The newly opened inventory view, or null if it could not be opened.
InventoryView org.bukkit.entity.HumanEntity.openInventory ( Inventory  inventory)

Opens an inventory window with the specified inventory on the top and the player's inventory on the bottom.

Parameters
inventoryThe inventory to open
Returns
The newly opened inventory view
void org.bukkit.entity.HumanEntity.openInventory ( InventoryView  inventory)

Opens an inventory window to the specified inventory view.

Parameters
inventoryThe view to open
InventoryView org.bukkit.entity.HumanEntity.openWorkbench ( Location  location,
boolean  force 
)

Opens an empty workbench inventory window with the player's inventory on the bottom.

Parameters
locationThe location to attach it to. If null, the player's location is used.
forceIf false, and there is no workbench block at the location, no inventory will be opened and null will be returned.
Returns
The newly opened inventory view, or null if it could not be opened.
void org.bukkit.entity.HumanEntity.setGameMode ( GameMode  mode)

Sets this humans current GameMode.

Parameters
modeNew game mode

Referenced by org.bukkit.command.defaults.GameModeCommand.execute().

void org.bukkit.entity.HumanEntity.setItemInHand ( ItemStack  item)

Sets the item to the given ItemStack, this will replace whatever the user was holding.

Parameters
itemThe ItemStack which will end up in the hand
void org.bukkit.entity.HumanEntity.setItemOnCursor ( ItemStack  item)

Sets the item to the given ItemStack, this will replace whatever the user was moving.

Will always be empty if the player currently has no open window.

Parameters
itemThe ItemStack which will end up in the hand

Referenced by org.bukkit.inventory.InventoryView.setCursor().

boolean org.bukkit.entity.HumanEntity.setWindowProperty ( InventoryView.Property  prop,
int  value 
)

If the player currently has an inventory window open, this method will set a property of that window, such as the state of a progress bar.

Parameters
propThe property.
valueThe value to set the property to.
Returns
True if the property was successfully set.

Referenced by org.bukkit.inventory.InventoryView.setProperty().


The documentation for this interface was generated from the following file: