public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, InventoryHolder
Modifier and Type | Method and Description |
---|---|
void |
closeInventory()
Force-closes the currently open inventory view for this player, if any.
|
Inventory |
getEnderChest()
Get the player's EnderChest inventory
|
int |
getExpToLevel()
Get the total amount of experience required for the player to level
|
GameMode |
getGameMode()
Gets this human's current
GameMode |
PlayerInventory |
getInventory()
Get the player's inventory.
|
ItemStack |
getItemInHand()
Returns the ItemStack currently in your hand, can be empty.
|
ItemStack |
getItemOnCursor()
Returns the ItemStack currently on your cursor, can be empty.
|
String |
getName()
Returns the name of this player
|
InventoryView |
getOpenInventory()
Gets the inventory view the player is currently viewing.
|
int |
getSleepTicks()
Get the sleep ticks of the player.
|
boolean |
isBlocking()
Check if the player is currently blocking (ie with a sword).
|
boolean |
isSleeping()
Returns whether this player is slumbering.
|
InventoryView |
openEnchanting(Location location,
boolean force)
Opens an empty enchanting inventory window with the player's inventory
on the bottom.
|
InventoryView |
openInventory(Inventory inventory)
Opens an inventory window with the specified inventory on the top and
the player's inventory on the bottom.
|
void |
openInventory(InventoryView inventory)
Opens an inventory window to the specified inventory view.
|
InventoryView |
openWorkbench(Location location,
boolean force)
Opens an empty workbench inventory window with the player's inventory
on the bottom.
|
void |
setGameMode(GameMode mode)
Sets this human's current
GameMode |
void |
setItemInHand(ItemStack item)
Sets the item to the given ItemStack, this will replace whatever the
user was holding.
|
void |
setItemOnCursor(ItemStack item)
Sets the item to the given ItemStack, this will replace whatever the
user was moving.
|
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.
|
_INVALID_getLastDamage, _INVALID_setLastDamage, addPotionEffect, addPotionEffect, addPotionEffects, getActivePotionEffects, getCanPickupItems, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getNoDamageTicks, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, hasLineOfSight, hasPotionEffect, isLeashed, removePotionEffect, setCanPickupItems, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, shootArrow, throwEgg, throwSnowball
_INVALID_damage, _INVALID_damage, _INVALID_getHealth, _INVALID_getMaxHealth, _INVALID_setHealth, _INVALID_setMaxHealth, damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth
eject, getCustomName, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWorld, isCustomNameVisible, isDead, isEmpty, isInsideVehicle, isOnGround, isValid, leaveVehicle, playEffect, remove, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setLastDamageCause, setPassenger, setTicksLived, setVelocity, teleport, teleport, teleport, teleport
getMetadata, hasMetadata, removeMetadata, setMetadata
sendMessage, sendMessage
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
isOp, setOp
launchProjectile, launchProjectile
getUniqueId
String getName()
getName
in interface AnimalTamer
getName
in interface CommandSender
PlayerInventory getInventory()
getInventory
in interface InventoryHolder
Inventory getEnderChest()
boolean setWindowProperty(InventoryView.Property prop, int value)
prop
- The property.value
- The value to set the property to.InventoryView getOpenInventory()
InventoryView openInventory(Inventory inventory)
inventory
- The inventory to openInventoryView openWorkbench(Location location, boolean force)
location
- The location to attach it to. If null, the player's
location is used.force
- If false, and there is no workbench block at the location,
no inventory will be opened and null will be returned.InventoryView openEnchanting(Location location, boolean force)
location
- The location to attach it to. If null, the player's
location is used.force
- If false, and there is no enchanting table at the
location, no inventory will be opened and null will be returned.void openInventory(InventoryView inventory)
inventory
- The view to openvoid closeInventory()
ItemStack getItemInHand()
void setItemInHand(ItemStack item)
item
- The ItemStack which will end up in the handItemStack getItemOnCursor()
void setItemOnCursor(ItemStack item)
item
- The ItemStack which will end up in the handboolean isSleeping()
int getSleepTicks()
void setGameMode(GameMode mode)
GameMode
mode
- New game modeboolean isBlocking()
int getExpToLevel()
Copyright © 2015. All rights reserved.