public interface Player extends CommandSource, net.kyori.adventure.identity.Identified, InboundConnection, ChannelMessageSource, ChannelMessageSink
| Modifier and Type | Method and Description |
|---|---|
void |
clearHeaderAndFooter()
Deprecated.
|
ConnectionRequestBuilder |
createConnectionRequest(RegisteredServer server)
Creates a new connection request so that the player can connect to another server.
|
void |
disconnect(net.kyori.text.Component reason)
Deprecated.
Use
disconnect(Component) instead |
void |
disconnect(net.kyori.adventure.text.Component reason)
Disconnects the player with the specified reason.
|
Optional<ServerConnection> |
getCurrentServer()
Returns the server that the player is currently connected to.
|
GameProfile |
getGameProfile()
Returns the player's game profile.
|
List<GameProfile.Property> |
getGameProfileProperties()
Gets the player's profile properties.
|
Optional<ModInfo> |
getModInfo()
Returns the player's mod info if they have a modded client.
|
long |
getPing()
Returns the current player's ping.
|
PlayerSettings |
getPlayerSettings()
Returns the player's client settings.
|
TabList |
getTabList()
Returns the player's tab list.
|
UUID |
getUniqueId()
Returns the player's UUID.
|
String |
getUsername()
Returns the player's current username.
|
boolean |
isOnlineMode()
Returns the player's connection status.
|
default void |
sendMessage(net.kyori.text.Component component)
Deprecated.
Use
Audience.sendMessage(Identified, Component)
or Audience.sendMessage(Identity, Component) instead |
void |
sendMessage(net.kyori.text.Component component,
MessagePosition position)
Deprecated.
Use @deprecated Use
Audience.sendMessage(Identified, Component) or
Audience.sendMessage(Identity, Component) for chat messages, or
Audience.sendActionBar(net.kyori.adventure.text.Component) for action bar messages |
void |
sendResourcePack(String url)
Sends the specified resource pack from
url to the user. |
void |
sendResourcePack(String url,
byte[] hash)
Sends the specified resource pack from
url to the user, using the specified 20-byte
SHA-1 hash. |
void |
sendTitle(Title title)
Deprecated.
Use
Audience.showTitle(net.kyori.adventure.title.Title) and Audience.resetTitle() |
void |
setGameProfileProperties(List<GameProfile.Property> properties)
Sets the player's profile properties.
|
void |
setHeaderAndFooter(net.kyori.text.Component header,
net.kyori.text.Component footer)
Deprecated.
|
void |
spoofChatInput(String input)
Sends chat input onto the players current server as if they typed it into the client chat box.
|
sendMessageaudience, audience, clearTitle, empty, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, showBossBar, showTitle, stopSound, toAudiencegetPermissionValue, hasPermissiongetProtocolVersion, getRemoteAddress, getVirtualHost, isActivesendPluginMessageString getUsername()
UUID getUniqueId()
Optional<ServerConnection> getCurrentServer()
Optional the server that the player is connected to, which may be emptyPlayerSettings getPlayerSettings()
Optional<ModInfo> getModInfo()
Optional the mod info. which may be emptylong getPing()
boolean isOnlineMode()
@Deprecated default void sendMessage(net.kyori.text.Component component)
Audience.sendMessage(Identified, Component)
or Audience.sendMessage(Identity, Component) insteadsendMessage in interface CommandSourcecomponent - the chat message to send@Deprecated void sendMessage(net.kyori.text.Component component, MessagePosition position)
Audience.sendMessage(Identified, Component) or
Audience.sendMessage(Identity, Component) for chat messages, or
Audience.sendActionBar(net.kyori.adventure.text.Component) for action bar messagescomponent - the chat message to sendposition - the position for the messageConnectionRequestBuilder createConnectionRequest(RegisteredServer server)
server - the server to connect toList<GameProfile.Property> getGameProfileProperties()
The returned list may be unmodifiable.
void setGameProfileProperties(List<GameProfile.Property> properties)
properties - the propertiesGameProfile getGameProfile()
@Deprecated void setHeaderAndFooter(net.kyori.text.Component header, net.kyori.text.Component footer)
TabList.setHeaderAndFooter(Component, Component).header - the header componentfooter - the footer component@Deprecated void clearHeaderAndFooter()
TabList.clearHeaderAndFooter().TabList getTabList()
@Deprecated void disconnect(net.kyori.text.Component reason)
disconnect(Component) insteadPlayer methods will become undefined.reason - component with the reasonvoid disconnect(net.kyori.adventure.text.Component reason)
Player methods will become undefined.reason - component with the reason@Deprecated void sendTitle(Title title)
Audience.showTitle(net.kyori.adventure.title.Title) and Audience.resetTitle()title - the title to sendvoid spoofChatInput(String input)
input - the chat input to sendvoid sendResourcePack(String url)
url to the user. If at all possible, send the
resource pack using sendResourcePack(String, byte[]). To monitor the status of the
sent resource pack, subscribe to PlayerResourcePackStatusEvent.url - the URL for the resource packvoid sendResourcePack(String url, byte[] hash)
url to the user, using the specified 20-byte
SHA-1 hash. To monitor the status of the sent resource pack, subscribe to
PlayerResourcePackStatusEvent.url - the URL for the resource packhash - the SHA-1 hash value for the resource pack