public abstract class AbstractProxyPlayer extends AbstractEntity implements Player
| Constructor and Description |
|---|
AbstractProxyPlayer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPotionEffect(PotionEffectType type,
int duration,
int amplifier) |
void |
closeInventory() |
void |
damage(double amount)
Damage player according to damage amount
|
boolean |
equals(Object obj) |
List<PotionEffect> |
getActivePotionEffect() |
boolean |
getAllowFlight()
Check if the player is authorized to fly
|
BoundingBox |
getBoundingBox()
Get the bounding box of the current entity
|
String |
getEntityId()
Get the entity ID
|
double |
getEyeHeight() |
Location |
getEyeLocation() |
float |
getFallDistance()
Get the player fall distance when player fall
|
float |
getFlySpeed()
Get player fly speed
|
int |
getFoodLevel()
Get the current player food level
|
GameMode |
getGameMode()
Get player gamemode
|
double |
getHealth()
Get the player health
|
PlayerInventory |
getInventory() |
ItemStack |
getItemInHand()
Get the item in main hand
Return null if there is not any item in hand
|
ItemStack |
getItemInOffHand()
Get the item in second hand
Compatible with 1.8 and lower.
|
int |
getLevel()
Get player XP level
|
double |
getMaxHealth()
Get the max player health
|
List<Entity> |
getNearbyEntities(double x,
double y,
double z) |
Inventory |
getOpenInventory() |
Optional<PotionEffect> |
getPotionEffect(PotionEffectType type) |
Vector |
getRotation()
Get the rotation (also called "direction") of the entity
|
Vector |
getTheoricVelocity()
Get the velocity that the entity SHOULD be take
|
Entity |
getVehicle()
Get the entity which is used as vehicle.
|
Vector |
getVelocity()
Get current entity velocity
|
float |
getWalkSpeed()
Get player walk speed
|
World |
getWorld()
Get player world
|
boolean |
hasElytra()
Check if the player is using elytra (flying with it)
(compatible with 1.8 and lower)
|
boolean |
hasLineOfSight(Entity entity)
Check if player can see the specified entity
|
boolean |
hasOpenInventory() |
boolean |
hasPotionEffect(PotionEffectType type) |
boolean |
isDead()
Know if the player is dead
|
boolean |
isFlying()
Check if the player is flying
|
boolean |
isInsideVehicle()
Check if player is in a vehicle.
|
boolean |
isSleeping()
Know if the player is sleeping
|
boolean |
isSneaking() |
boolean |
isSprinting() |
boolean |
isSwimming()
Know if the player is swimming
(compatible with 1.8 and lower)
|
boolean |
isUsingRiptide()
Know if the player is currently using riptide effect
(compatible with 1.12 and lower)
|
void |
openInventory(Inventory inv) |
void |
removePotionEffect(PotionEffectType type) |
void |
setAllowFlight(boolean b)
Edit the authorization to fly
|
void |
setFoodLevel(int foodlevel)
Change the food level
|
void |
setGameMode(GameMode gameMode)
Set the player gamemode
Warn: support only default gamemode.
|
void |
setHealth(double health)
Change the player health
|
void |
setPlayerVersion(Version version) |
void |
setProtocolVersion(int protocolVersion) |
void |
setSneaking(boolean b) |
void |
setSprinting(boolean b) |
void |
setVanished(boolean vanished)
Sets whether the play should be visible to other players.
|
void |
setVelocity(Vector vel)
Edit the entity velocity
|
void |
teleport(Entity et)
Teleport player to specified entity
|
void |
teleport(Location loc)
Teleport player to specified location
|
void |
updateInventory() |
applyTheoricVelocity, getTargetBlock, toStringclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPotionEffect, getAddress, getIP, getPing, getPlayerVersion, getProtocolVersion, getServerName, hasPermission, hasPlayedBefore, isSamePlayer, kick, queuePacket, sendPacket, sendPluginMessage, sendPluginMessage, sendToServergetLocation, getType, getUniqueId, isOnGround, isOnline, sendMessageapplyTheoricVelocity, getTargetBlock, isOp, isSameId, isSameIdgetNamegetDefaultpublic boolean isDead()
Playerpublic boolean isSleeping()
PlayerisSleeping in interface Playerpublic boolean isSwimming()
PlayerisSwimming in interface Playerpublic boolean isUsingRiptide()
PlayerisUsingRiptide in interface Playerpublic boolean hasElytra()
Playerpublic boolean getAllowFlight()
PlayergetAllowFlight in interface Playerpublic boolean hasLineOfSight(Entity entity)
PlayerhasLineOfSight in interface Playerentity - the entity to seepublic boolean isFlying()
Playerpublic void setAllowFlight(boolean b)
PlayersetAllowFlight in interface Playerb - true if the player is allowed to flypublic int getLevel()
Playerpublic int getFoodLevel()
PlayergetFoodLevel in interface Playerpublic void setFoodLevel(int foodlevel)
PlayersetFoodLevel in interface Playerfoodlevel - the new food levelpublic float getFlySpeed()
PlayergetFlySpeed in interface Playerpublic float getWalkSpeed()
PlayergetWalkSpeed in interface Playerpublic float getFallDistance()
PlayergetFallDistance in interface Playerpublic double getHealth()
Playerpublic double getMaxHealth()
PlayergetMaxHealth in interface Playerpublic void setHealth(double health)
Playerpublic GameMode getGameMode()
PlayergetGameMode in interface Playerpublic void setGameMode(GameMode gameMode)
PlayersetGameMode in interface PlayergameMode - the new player gamemodepublic void damage(double amount)
Playerpublic void teleport(Location loc)
Playerpublic void teleport(Entity et)
Playerpublic boolean isSneaking()
isSneaking in interface Playerpublic void setSneaking(boolean b)
setSneaking in interface Playerpublic boolean isSprinting()
isSprinting in interface Playerpublic void setSprinting(boolean b)
setSprinting in interface Playerpublic Entity getVehicle()
PlayergetVehicle in interface Playerpublic boolean isInsideVehicle()
PlayerisInsideVehicle in interface Playerpublic ItemStack getItemInHand()
PlayergetItemInHand in interface Playerpublic ItemStack getItemInOffHand()
PlayergetItemInOffHand in interface Playerpublic boolean hasPotionEffect(PotionEffectType type)
hasPotionEffect in interface Playerpublic List<PotionEffect> getActivePotionEffect()
getActivePotionEffect in interface Playerpublic Optional<PotionEffect> getPotionEffect(PotionEffectType type)
getPotionEffect in interface Playerpublic void addPotionEffect(PotionEffectType type, int duration, int amplifier)
addPotionEffect in interface Playerpublic void removePotionEffect(PotionEffectType type)
removePotionEffect in interface Playerpublic List<Entity> getNearbyEntities(double x, double y, double z)
getNearbyEntities in interface Playerpublic PlayerInventory getInventory()
getInventory in interface Playerpublic Inventory getOpenInventory()
getOpenInventory in interface Playerpublic boolean hasOpenInventory()
hasOpenInventory in interface Playerpublic void openInventory(Inventory inv)
openInventory in interface Playerpublic void closeInventory()
closeInventory in interface Playerpublic void updateInventory()
updateInventory in interface Playerpublic void setVanished(boolean vanished)
PlayersetVanished in interface Playervanished - true is the player should NOT be visiblepublic Vector getVelocity()
EntitygetVelocity in interface EntitygetVelocity in interface OfflinePlayergetVelocity in class AbstractEntitypublic void setVelocity(Vector vel)
EntitysetVelocity in interface EntitysetVelocity in interface OfflinePlayervel - the new velocitypublic double getEyeHeight()
getEyeHeight in interface EntitygetEyeHeight in interface OfflinePlayerpublic Location getEyeLocation()
getEyeLocation in interface EntitygetEyeLocation in interface OfflinePlayerpublic Vector getRotation()
EntitygetRotation in interface EntitygetRotation in interface OfflinePlayerpublic String getEntityId()
EntitygetEntityId in interface Entitypublic BoundingBox getBoundingBox()
EntitygetBoundingBox in interface Entitypublic Vector getTheoricVelocity()
EntitygetTheoricVelocity in interface EntitygetTheoricVelocity in interface OfflinePlayerpublic void setPlayerVersion(Version version)
setPlayerVersion in interface Playerpublic void setProtocolVersion(int protocolVersion)
setProtocolVersion in interface Player