AnimalTamer
, Attributable
, CommandSender
, Damageable
, Entity
, InventoryHolder
, LivingEntity
, Metadatable
, Nameable
, Permissible
, ProjectileSource
, ServerOperator
Player
public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, InventoryHolder
Entity.Spigot
Modifier and Type | Method | Description |
---|---|---|
void |
closeInventory() |
Force-closes the currently open inventory view for this player, if any.
|
int |
getCooldown(Material material) |
Get the cooldown time in ticks remaining for the specified material.
|
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
|
java.lang.String |
getName() |
Returns the name of this player
|
InventoryView |
getOpenInventory() |
Gets the inventory view the player is currently viewing.
|
Entity |
getShoulderEntityLeft() |
Deprecated.
There are currently no well defined semantics regarding
serialized entities in Bukkit.
|
Entity |
getShoulderEntityRight() |
Deprecated.
There are currently no well defined semantics regarding
serialized entities in Bukkit.
|
int |
getSleepTicks() |
Get the sleep ticks of the player.
|
boolean |
hasCooldown(Material material) |
Check whether a cooldown is active on the specified material.
|
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 |
openMerchant(Merchant merchant,
boolean force) |
Starts a trade between the player and the merchant.
|
InventoryView |
openWorkbench(Location location,
boolean force) |
Opens an empty workbench inventory window with the player's inventory
on the bottom.
|
void |
setCooldown(Material material,
int ticks) |
Set a cooldown on the specified material for a certain amount of ticks.
|
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.
|
void |
setShoulderEntityLeft(Entity entity) |
Deprecated.
There are currently no well defined semantics regarding
serialized entities in Bukkit.
|
void |
setShoulderEntityRight(Entity entity) |
Deprecated.
There are currently no well defined semantics regarding
serialized entities in Bukkit.
|
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.
|
getUniqueId
getAttribute
sendMessage, sendMessage
damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth
addPassenger, addScoreboardTag, eject, getEntityId, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPortalCooldown, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport
addPotionEffect, addPotionEffect, addPotionEffects, getActivePotionEffects, getCanPickupItems, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, hasAI, hasLineOfSight, hasPotionEffect, isCollidable, isGliding, isLeashed, removePotionEffect, setAI, setCanPickupItems, setCollidable, setGliding, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway
getMetadata, hasMetadata, removeMetadata, setMetadata
getCustomName, setCustomName
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
launchProjectile, launchProjectile
isOp, setOp
java.lang.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 tradingInventoryView openMerchant(Merchant merchant, boolean force)
merchant
- 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 hasCooldown(Material material)
material
- the material to checkint getCooldown(Material material)
material
- the material to checkvoid setCooldown(Material material, int ticks)
Cooldowns are used by the server for items such as ender pearls and shields to prevent them from being used repeatedly.
Note that cooldowns will not by themselves stop an item from being used for attacking.
material
- the material to set the cooldown forticks
- the amount of ticks to set or 0 to removeboolean isSleeping()
int getSleepTicks()
void setGameMode(GameMode mode)
GameMode
mode
- New game modeboolean isBlocking()
boolean isHandRaised()
int getExpToLevel()
@Deprecated Entity getShoulderEntityLeft()
@Deprecated void setShoulderEntityLeft(Entity entity)
Parrot
entities.entity
- left shoulder entity@Deprecated Entity getShoulderEntityRight()
@Deprecated void setShoulderEntityRight(Entity entity)
Parrot
entities.entity
- right shoulder entityCopyright © 2018. All rights reserved.