public abstract class AbstractProxyPlayer extends AbstractPlayer
location, playerVersion, protocolVersion, velocity, world
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
|
int |
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
|
CompensatedWorld |
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 |
setFlying(boolean b) |
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, getLocation, getPlayerVersion, getProtocolVersion, getTargetBlock, init, setInternalWorld, setLocation
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPotionEffect, getAddress, getIP, getPing, getServerName, hasPermission, hasPlayedBefore, hasThorns, isInBoat, isSamePlayer, kick, queuePacket, sendPacket, sendPluginMessage, sendPluginMessage, sendToServer, setSleeping
getType, getUniqueId, isOnGround, isOnline, sendMessage
isOp, isSameId, isSameId, isSameId
getName
getDefault
public boolean isDead()
Player
public boolean isSleeping()
Player
public boolean isSwimming()
Player
public boolean isUsingRiptide()
Player
public boolean hasElytra()
Player
public boolean getAllowFlight()
Player
public boolean hasLineOfSight(Entity entity)
Player
entity
- the entity to seepublic boolean isFlying()
Player
public void setFlying(boolean b)
public void setAllowFlight(boolean b)
Player
b
- true if the player is allowed to flypublic int getLevel()
Player
public int getFoodLevel()
Player
public void setFoodLevel(int foodlevel)
Player
foodlevel
- the new food levelpublic float getFlySpeed()
Player
public float getWalkSpeed()
Player
public float getFallDistance()
Player
public double getHealth()
Player
public double getMaxHealth()
Player
public void setHealth(double health)
Player
health
- next healthpublic GameMode getGameMode()
Player
public void setGameMode(GameMode gameMode)
Player
gameMode
- the new player gamemodepublic void damage(double amount)
Player
amount
- the quantity of damagepublic void teleport(Location loc)
Player
loc
- location destinationpublic void teleport(Entity et)
Player
et
- entity destinationpublic boolean isSneaking()
public void setSneaking(boolean b)
public boolean isSprinting()
public void setSprinting(boolean b)
public CompensatedWorld getWorld()
Player
getWorld
in interface Entity
getWorld
in interface OfflinePlayer
getWorld
in interface Player
getWorld
in class AbstractPlayer
public Entity getVehicle()
Player
public boolean isInsideVehicle()
Player
public ItemStack getItemInHand()
Player
public ItemStack getItemInOffHand()
Player
public boolean hasPotionEffect(PotionEffectType type)
public List<PotionEffect> getActivePotionEffect()
public Optional<PotionEffect> getPotionEffect(PotionEffectType type)
public void addPotionEffect(PotionEffectType type, int duration, int amplifier)
public void removePotionEffect(PotionEffectType type)
public PlayerInventory getInventory()
public Inventory getOpenInventory()
public boolean hasOpenInventory()
public void openInventory(Inventory inv)
public void closeInventory()
public void updateInventory()
public void setVanished(boolean vanished)
Player
vanished
- true is the player should NOT be visiblepublic Vector getVelocity()
Player
getVelocity
in interface Player
getVelocity
in class AbstractPlayer
public void setVelocity(Vector vel)
Player
vel
- the new velocitypublic double getEyeHeight()
public Location getEyeLocation()
public Vector getRotation()
Entity
public int getEntityId()
Entity
public BoundingBox getBoundingBox()
Entity
public Vector getTheoricVelocity()
Player
public void setPlayerVersion(Version version)
setPlayerVersion
in interface Player
setPlayerVersion
in class AbstractPlayer
public void setProtocolVersion(int protocolVersion)
setProtocolVersion
in interface Player
setProtocolVersion
in class AbstractPlayer
public boolean equals(Object obj)
equals
in class AbstractPlayer