public interface Player extends Creature, InventoryHolder
| Modifier and Type | Method and Description |
|---|---|
default byte |
addWindow(Inventory window) |
default byte |
addWindow(Inventory window,
Byte forceId) |
byte |
addWindow(Inventory window,
Byte forceId,
boolean isPermanent) |
CardinalDirection |
getCardinalDirection() |
CraftingGrid |
getCraftingInventory() |
String |
getDisplayName() |
ContainerInventory |
getEnderChestInventory() |
OptionalLong |
getFirstPlayed()
Returns the time this player first played on this server.
|
GameMode |
getGamemode() |
PlayerInventory |
getInventory() |
OptionalLong |
getLastPlayed()
Returns the time this player last joined in this server.
|
Level |
getLevel() |
float |
getMovementSpeed() |
String |
getName()
Returns the name of this player.
|
Server |
getServer()
Returns the
Server object carrying this player. |
UUID |
getServerId() |
Skin |
getSkin() |
Location |
getSpawn() |
EnderChest |
getViewingEnderChest() |
byte |
getWindowId(Inventory inventory) |
String |
getXuid() |
boolean |
hasPlayedBefore()
Checks if the player has played on this server before.
|
boolean |
isAdventure() |
boolean |
isBanned()
Checks if this player is banned.
|
boolean |
isConnected() |
boolean |
isCreative() |
boolean |
isInsideOfWater() |
boolean |
isOnGround() |
boolean |
isOnline()
Checks if this player is currently online.
|
boolean |
isOp() |
boolean |
isSleeping() |
boolean |
isSneaking() |
boolean |
isSpawned() |
boolean |
isSpectator() |
boolean |
isSurvival() |
boolean |
isWhitelisted()
Checks if this player is whitelisted.
|
void |
removeWindow(Inventory inventory) |
void |
resetInAirTicks() |
default void |
save() |
void |
save(boolean async) |
void |
setBanned(boolean value)
Sets this player to be banned or to be pardoned.
|
void |
setMovementSpeed(float speed) |
void |
setOp(boolean value) |
void |
setSkin(Skin newSkin) |
void |
setSpawn(Location spawn) |
void |
setViewingEnderChest(EnderChest chest) |
void |
setWhitelisted(boolean value)
Adds or removes this player from the whitelist.
|
boolean |
sleepOn(com.nukkitx.math.vector.Vector3i pos) |
void |
stopSleep() |
addEffect, attack, attack, canBeMovedByCurrents, canCollide, canCollideWith, canPassThrough, canTriggerPressurePlate, close, despawnFrom, despawnFromAll, dismount, extinguish, fall, getAbsorption, getBoundingBox, getChunk, getDirection, getDirectionPlane, getDirectionVector, getDrag, getEffect, getEffect, getEffects, getEyeHeight, getFireTicks, getGravity, getHealth, getHeight, getHighestPosition, getHorizontalDirection, getLastDamageCause, getLength, getLocation, getMaxHealth, getMotion, getNameTag, getNoDamageTicks, getOwner, getPassengers, getPitch, getPosition, getRuntimeId, getScale, getSeatPosition, getType, getUniqueId, getVehicle, getViewers, getWidth, getX, getY, getYaw, getZ, hasControllingPassenger, hasEffect, hasEffect, hasNameTag, heal, heal, isAlive, isClosed, isControlling, isNameTagVisible, isOnFire, isPassenger, isUndead, kill, mount, mount, onDismount, onEntityCollision, onInteract, onMount, onStruckByLightning, onUpdate, removeAllEffects, removeEffect, removeEffect, resetFallDistance, setAbsorption, setHealth, setHighestPosition, setMaxHealth, setMotion, setNameTag, setNameTagVisible, setNoDamageTicks, setOnFire, setOnGround, setOwner, setPosition, setPositionAndRotation, setRotation, setScale, setSeatPosition, spawnTo, spawnToAll, teleport, teleport, teleport, teleportboolean isOnline()
String getName()
UUID getServerId()
boolean isBanned()
void setBanned(boolean value)
value - true if bannedboolean isWhitelisted()
void setWhitelisted(boolean value)
value - true if whitelistedOptionalLong getFirstPlayed()
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
OptionalLong getLastPlayed()
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
boolean hasPlayedBefore()
boolean isInsideOfWater()
boolean isSneaking()
boolean isSleeping()
boolean sleepOn(com.nukkitx.math.vector.Vector3i pos)
void stopSleep()
boolean isOnGround()
isOnGround in interface EntityPlayerInventory getInventory()
getInventory in interface InventoryHolderContainerInventory getEnderChestInventory()
CraftingGrid getCraftingInventory()
void setOp(boolean value)
boolean isOp()
void setMovementSpeed(float speed)
float getMovementSpeed()
boolean isSpectator()
boolean isCreative()
boolean isSurvival()
void resetInAirTicks()
boolean isSpawned()
GameMode getGamemode()
byte getWindowId(Inventory inventory)
default byte addWindow(Inventory window)
void removeWindow(Inventory inventory)
String getDisplayName()
String getXuid()
boolean isConnected()
default void save()
void save(boolean async)
CardinalDirection getCardinalDirection()
boolean isAdventure()
Location getSpawn()
void setSpawn(Location spawn)
Skin getSkin()
void setSkin(Skin newSkin)
EnderChest getViewingEnderChest()
void setViewingEnderChest(EnderChest chest)
Copyright © 2021. All rights reserved.