- All Superinterfaces:
Creature,Entity,InventoryHolder
-
Method Summary
Modifier and TypeMethodDescriptiondefault bytedefault bytebyteReturns the time this player first played on this server.Returns the time this player last joined in this server.getLevel()floatgetName()Returns the name of this player.Returns theServerobject carrying this player.getSkin()getSpawn()bytegetWindowId(Inventory inventory)getXuid()booleanChecks if the player has played on this server before.booleanbooleanisBanned()Checks if this player is banned.booleanbooleanbooleanbooleanbooleanisOnline()Checks if this player is currently online.booleanisOp()booleanbooleanbooleanbooleanbooleanbooleanChecks if this player is whitelisted.voidremoveWindow(Inventory inventory)voiddefault voidsave()voidsave(boolean async)voidsetBanned(boolean value)Sets this player to be banned or to be pardoned.voidsetMovementSpeed(float speed)voidsetOp(boolean value)voidvoidvoidsetViewingEnderChest(EnderChest chest)voidsetWhitelisted(boolean value)Adds or removes this player from the whitelist.booleansleepOn(com.nukkitx.math.vector.Vector3i pos)voidMethods inherited from interface org.cloudburstmc.api.entity.Entity
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, teleport
-
Method Details
-
isOnline
boolean isOnline()Checks if this player is currently online.- Returns:
- true if they are online
-
getName
String getName()Returns the name of this player. -
getServerId
UUID getServerId() -
isBanned
boolean isBanned()Checks if this player is banned.- Returns:
- true if banned
-
setBanned
void setBanned(boolean value)Sets this player to be banned or to be pardoned.- Parameters:
value- true if banned
-
isWhitelisted
boolean isWhitelisted()Checks if this player is whitelisted.- Returns:
- true if whitelisted
-
setWhitelisted
void setWhitelisted(boolean value)Adds or removes this player from the whitelist.- Parameters:
value- true if whitelisted
-
getServer
Server getServer()Returns theServerobject carrying this player. -
getFirstPlayed
OptionalLong getFirstPlayed()Returns the time this player first played on this server.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.
- Returns:
- An optional with the time this player first played on this server
-
getLastPlayed
OptionalLong getLastPlayed()Returns the time this player last joined in this server.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.
- Returns:
- An optional with the time this player last played on this server
-
hasPlayedBefore
boolean hasPlayedBefore()Checks if the player has played on this server before.- Returns:
- true if this player has played before
-
isInsideOfWater
boolean isInsideOfWater() -
isSneaking
boolean isSneaking() -
isSleeping
boolean isSleeping() -
sleepOn
boolean sleepOn(com.nukkitx.math.vector.Vector3i pos) -
stopSleep
void stopSleep() -
isOnGround
boolean isOnGround()- Specified by:
isOnGroundin interfaceEntity
-
getInventory
PlayerInventory getInventory()- Specified by:
getInventoryin interfaceInventoryHolder
-
getEnderChestInventory
ContainerInventory getEnderChestInventory() -
getCraftingInventory
CraftingGrid getCraftingInventory() -
setOp
void setOp(boolean value) -
isOp
boolean isOp() -
setMovementSpeed
void setMovementSpeed(float speed) -
getMovementSpeed
float getMovementSpeed() -
getLevel
Level getLevel() -
isSpectator
boolean isSpectator() -
isCreative
boolean isCreative() -
isSurvival
boolean isSurvival() -
resetInAirTicks
void resetInAirTicks() -
isSpawned
boolean isSpawned() -
getGamemode
GameMode getGamemode() -
getWindowId
-
addWindow
-
addWindow
-
addWindow
-
removeWindow
-
getDisplayName
String getDisplayName() -
getXuid
String getXuid() -
isConnected
boolean isConnected() -
save
default void save() -
save
void save(boolean async) -
getCardinalDirection
CardinalDirection getCardinalDirection() -
isAdventure
boolean isAdventure() -
getSpawn
Location getSpawn() -
setSpawn
-
getSkin
Skin getSkin() -
setSkin
-
getViewingEnderChest
EnderChest getViewingEnderChest() -
setViewingEnderChest
-