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, setLocationclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPotionEffect, getAddress, getIP, getPing, getServerName, hasPermission, hasPlayedBefore, hasThorns, isInBoat, isSamePlayer, kick, queuePacket, sendPacket, sendPluginMessage, sendPluginMessage, sendToServer, setSleepinggetType, getUniqueId, isOnGround, isOnline, sendMessageisOp, isSameId, isSameId, isSameIdgetNamegetDefaultpublic boolean isDead()
Playerpublic boolean isSleeping()
Playerpublic boolean isSwimming()
Playerpublic boolean isUsingRiptide()
Playerpublic boolean hasElytra()
Playerpublic boolean getAllowFlight()
Playerpublic boolean hasLineOfSight(Entity entity)
Playerentity - the entity to seepublic boolean isFlying()
Playerpublic void setFlying(boolean b)
public void setAllowFlight(boolean b)
Playerb - true if the player is allowed to flypublic int getLevel()
Playerpublic int getFoodLevel()
Playerpublic void setFoodLevel(int foodlevel)
Playerfoodlevel - the new food levelpublic float getFlySpeed()
Playerpublic float getWalkSpeed()
Playerpublic float getFallDistance()
Playerpublic double getHealth()
Playerpublic double getMaxHealth()
Playerpublic void setHealth(double health)
Playerhealth - next healthpublic GameMode getGameMode()
Playerpublic void setGameMode(GameMode gameMode)
PlayergameMode - the new player gamemodepublic void damage(double amount)
Playeramount - the quantity of damagepublic void teleport(Location loc)
Playerloc - location destinationpublic void teleport(Entity et)
Playeret - entity destinationpublic boolean isSneaking()
public void setSneaking(boolean b)
public boolean isSprinting()
public void setSprinting(boolean b)
public CompensatedWorld getWorld()
PlayergetWorld in interface EntitygetWorld in interface OfflinePlayergetWorld in interface PlayergetWorld in class AbstractPlayerpublic Entity getVehicle()
Playerpublic boolean isInsideVehicle()
Playerpublic ItemStack getItemInHand()
Playerpublic ItemStack getItemInOffHand()
Playerpublic 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)
Playervanished - true is the player should NOT be visiblepublic Vector getVelocity()
PlayergetVelocity in interface PlayergetVelocity in class AbstractPlayerpublic void setVelocity(Vector vel)
Playervel - the new velocitypublic double getEyeHeight()
public Location getEyeLocation()
public Vector getRotation()
Entitypublic int getEntityId()
Entitypublic BoundingBox getBoundingBox()
Entitypublic Vector getTheoricVelocity()
Playerpublic void setPlayerVersion(Version version)
setPlayerVersion in interface PlayersetPlayerVersion in class AbstractPlayerpublic void setProtocolVersion(int protocolVersion)
setProtocolVersion in interface PlayersetProtocolVersion in class AbstractPlayerpublic boolean equals(Object obj)
equals in class AbstractPlayer