public interface Player extends Human, User, LocatedSource, RemoteSource, Viewer
Any methods called on Player that are not on User do not store any data that persists across server restarts.
UNKNOWN
Modifier and Type | Method and Description |
---|---|
PlayerConnection |
getConnection()
Gets the appropriate
PlayerConnection linking this Player
to a client. |
default DisplayNameData |
getDisplayNameData()
Gets a copy of the current
DisplayNameData for this
Player . |
default GameModeData |
getGameModeData()
Gets a copy of the current
GameModeData for this Player . |
default JoinData |
getJoinData()
Gets a copy of the current
JoinData . |
Locale |
getLocale()
Gets the locale used by the player.
|
Scoreboard |
getScoreboard()
Gets the
Scoreboard displayed to the player. |
TabList |
getTabList()
Gets this player's
TabList . |
boolean |
isSleepingIgnored()
Gets whether this
Player will be ignored when checking whether to
skip the night due to players sleeping. |
void |
kick()
Kicks the player, showing the default kick reason (the translation key
disconnect.disconnected ). |
void |
kick(Text reason)
Kicks the player given a reason.
|
void |
sendResourcePack(ResourcePack pack)
Sends a given
ResourcePack to this player. |
void |
setScoreboard(Scoreboard scoreboard)
Sets the
Scoreboard displayed to the player. |
void |
setSleepingIgnored(boolean sleepingIgnored)
Sets whether this
Player will be ignored when checking whether
to skip the night due to players sleeping. |
closeInventory, getFoodData, getOpenInventory, isViewingInventory, openInventory
getHealthData, getMortalData
createSnapshot, damage, getLocation, getRotation, getScale, getTransform, getType, getWorld, isLoaded, isOnGround, isRemoved, remove, setLocation, setLocationAndRotation, setLocationAndRotation, setLocationAndRotationSafely, setLocationAndRotationSafely, setLocationSafely, setRotation, setScale, setTransform, transferToWorld, transferToWorld
setRawData, validateRawData
toContainer
getApplicableProperties, getProperty
copyFrom, copyFrom, get, getContainers, getOrCreate, offer, offer, offer, offer, offer, offer, remove, remove, remove, supports, transform, undo
copy, get, getKeys, getOrElse, getOrNull, getValue, getValues, supports, supports
getTeamRepresentation
launchProjectile, launchProjectile
getAchievementData, getBanData, getName, getPlayer, getProfile, getStatisticData, isOnline
getBoots, getChestplate, getHelmet, getItemInHand, getLeggings, setBoots, setChestplate, setHelmet, setItemInHand, setLeggings
canEquip, canEquip, equip, getEquipped
getLocation, getWorld
getMessageSink, getName, sendMessage, sendMessage, setMessageSink
getActiveContexts, getCommandSource, getContainingCollection, getIdentifier, getParents, getParents, getPermissionValue, getSubjectData, getTransientSubjectData, hasPermission, hasPermission, isChildOf, isChildOf
clearTitle, playSound, playSound, playSound, resetTitle, sendMessage, sendMessage, sendTitle, spawnParticles, spawnParticles
Locale getLocale()
PlayerConnection getConnection()
PlayerConnection
linking this Player
to a client.getConnection
in interface RemoteSource
void sendResourcePack(ResourcePack pack)
ResourcePack
to this player.pack
- The ResourcePack to sendvoid kick()
disconnect.disconnected
).void kick(Text reason)
reason
- The reason for the kickScoreboard getScoreboard()
Scoreboard
displayed to the player.void setScoreboard(Scoreboard scoreboard)
Scoreboard
displayed to the player.scoreboard
- The scoreboard to displaydefault JoinData getJoinData()
JoinData
.
Since a Player
is already online, it means that the player
has joined the server at least once, meaning there is a guaranteed
initial join Date
. Users may not have ever joined a server
before.
default DisplayNameData getDisplayNameData()
DisplayNameData
for this
Player
.default GameModeData getGameModeData()
GameModeData
for this Player
.boolean isSleepingIgnored()
Player
will be ignored when checking whether to
skip the night due to players sleeping. The time in a world will be
advanced to day if all players in it either are sleeping or have this
tag.Player
will be ignored when checking whether
to skip the nightvoid setSleepingIgnored(boolean sleepingIgnored)
Player
will be ignored when checking whether
to skip the night due to players sleeping. The time in a world will be
advanced to day if all players in it either are sleeping or have this
tag.sleepingIgnored
- Whether this Player
will be ignored when
checking whether to skip the night