McPlayer

Represents a Minecraft player.

This interface is intended for use in the common module.

For proxy, consider using su.plo.slib.api.proxy.player.McProxyPlayer.

For server, consider using su.plo.slib.api.server.entity.player.McServerPlayer.

Properties

Link copied to clipboard

Retrieves a new instance of McGameProfile.

Link copied to clipboard
abstract val isOnline: Boolean

Determines whether the player is currently online.

Link copied to clipboard
abstract val language: String

Gets the current language of the chat holder.

Link copied to clipboard
abstract val name: String

Retrieves the name of the player.

Link copied to clipboard
abstract val uuid: UUID

Retrieves the unique identifier of the player.

Functions

Link copied to clipboard
abstract fun <T> getInstance(): T

Gets the server's implementation instance for this player.

Link copied to clipboard
abstract fun getPermission(permission: String): PermissionTristate

Gets the tristate of a specific permission.

Link copied to clipboard
abstract fun hasPermission(permission: String): Boolean

Checks if the holder has a specific permission.

Link copied to clipboard
abstract fun kick(reason: McTextComponent)

Kicks the player from the server with the specified reason.

Link copied to clipboard
open fun sendActionBar(text: String)
abstract fun sendActionBar(text: McTextComponent)

Sends an action bar message to the chat holder.

Link copied to clipboard
open fun sendMessage(text: String)
abstract fun sendMessage(text: McTextComponent)

Sends a chat message to the chat holder.

Link copied to clipboard
abstract fun sendPacket(channel: String, data: ByteArray)

Sends a custom packet to the player to the specified channel.