public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, InventoryHolder
Entity.Spigot
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()
Deprecated.
Humans may now dual wield in their off hand, use explicit
methods in
PlayerInventory . |
ItemStack |
getItemOnCursor()
Returns the ItemStack currently on your cursor, can be empty.
|
MainHand |
getMainHand()
Gets the player's selected main hand
|
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 shield).
|
boolean |
isHandRaised()
Check if the player currently has their hand raised (ie about to begin
blocking).
|
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 |
openMerchant(Villager trader,
boolean force)
Starts a trade between the player and the villager.
|
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)
Deprecated.
Humans may now dual wield in their off hand, use explicit
methods in
PlayerInventory . |
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, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlock, hasAI, hasLineOfSight, hasPotionEffect, isCollidable, isGliding, isLeashed, removePotionEffect, setAI, setCanPickupItems, setCollidable, setGliding, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway
getAttribute
_INVALID_damage, _INVALID_damage, _INVALID_getHealth, _INVALID_getMaxHealth, _INVALID_setHealth, _INVALID_setMaxHealth, damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth
addScoreboardTag, eject, getCustomName, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isSilent, isValid, leaveVehicle, playEffect, remove, removeScoreboardTag, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPortalCooldown, setSilent, setTicksLived, setVelocity, spigot, 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()
MainHand getMainHand()
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 openInventoryView openMerchant(Villager trader, boolean force)
trader
- The merchant to trade with. Cannot be null.force
- whether to force the trade even if another player is tradingvoid closeInventory()
@Deprecated ItemStack getItemInHand()
PlayerInventory
.@Deprecated void setItemInHand(ItemStack item)
PlayerInventory
.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()
boolean isHandRaised()
int getExpToLevel()
Copyright © 2016. All rights reserved.