Player
endstone.Player
¶
Bases: Mob
Represents a player.
Methods:
| Name | Description |
|---|---|
close_form |
Closes the forms that are currently open for the player. |
give_exp |
Gives the player the amount of experience specified. |
give_exp_levels |
Gives the player the amount of experience levels specified. |
kick |
Kicks player with custom kick message. |
perform_command |
Makes the player perform the given command. |
play_sound |
Play a sound for a player at the location. |
reset_title |
Resets the title displayed to the player. |
send_form |
Sends a form to the player. |
send_map |
Render a map and send it to the player in its entirety. |
send_packet |
Sends a packet to the player. |
send_popup |
Sends this player a popup message. |
send_tip |
Sends this player a tip message. |
send_title |
Sends a title and a subtitle message to the player. |
send_toast |
Sends this player a toast notification. |
spawn_particle |
|
stop_all_sounds |
Stop all sounds from playing. |
stop_sound |
Stop the specified sound from playing. |
transfer |
Transfers the player to another server. |
update_commands |
Send the list of commands to the client. |
Attributes:
| Name | Type | Description |
|---|---|---|
address |
SocketAddress
|
The socket address of this player. |
allow_flight |
bool
|
Whether the Player is allowed to fly via jump key double-tap. |
device_id |
str
|
The player's current device id. |
device_os |
str
|
The player's current device's operation system (OS). |
ender_chest |
Inventory
|
The player's |
exp_level |
int
|
The player's current experience level. |
exp_progress |
float
|
The player's current experience progress towards the next level. |
fly_speed |
float
|
The current allowed speed that a client can fly. Default is 0.05. |
game_mode |
GameMode
|
The player's current |
game_version |
str
|
The player's current game version. |
inventory |
PlayerInventory
|
The player's inventory. This also contains the armor slots. |
is_flying |
bool
|
Whether the player is currently flying or not. |
is_op |
bool
|
Whether this player is a server operator. |
is_sneaking |
bool
|
Whether the player is in sneak mode. |
is_sprinting |
bool
|
Whether the player is sprinting or not. |
locale |
str
|
The player's current locale. |
name |
str
|
The name of this player. |
ping |
int
|
The player's average ping in milliseconds. |
scoreboard |
Scoreboard
|
The player's visible |
skin |
Skin
|
The player's skin. |
total_exp |
int
|
The player's total experience points. |
unique_id |
UUID
|
The UUID of this player. |
walk_speed |
float
|
The current allowed speed that a client can walk. Default is 0.10. |
xuid |
str
|
The Xbox User ID (XUID) of this player. |
allow_flight
property
writable
¶
allow_flight: bool
Whether the Player is allowed to fly via jump key double-tap.
exp_progress
property
writable
¶
exp_progress: float
The player's current experience progress towards the next level.
This is a percentage value. 0.0 is "no progress" and 1.0 is "next level".
fly_speed
property
writable
¶
fly_speed: float
The current allowed speed that a client can fly. Default is 0.05.
inventory
property
¶
inventory: PlayerInventory
The player's inventory. This also contains the armor slots.
name
property
¶
name: str
The name of this player.
May be an empty string if we have not seen a name for this player yet.
total_exp
property
¶
total_exp: int
The player's total experience points.
This refers to the total amount of experience the player has collected over time and is not currently displayed to the client.
walk_speed
property
writable
¶
walk_speed: float
The current allowed speed that a client can walk. Default is 0.10.
give_exp
¶
give_exp(amount: int) -> None
Gives the player the amount of experience specified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
Exp amount to give. |
required |
give_exp_levels
¶
give_exp_levels(amount: int) -> None
Gives the player the amount of experience levels specified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
Amount of experience levels to give or take. |
required |
kick
¶
kick(message: str) -> None
Kicks player with custom kick message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Kick message. |
required |
perform_command
¶
play_sound
¶
reset_title
¶
Resets the title displayed to the player.
This will clear the displayed title / subtitle and reset timings to their default values.
send_form
¶
send_form(
form: MessageForm | ActionForm | ModalForm,
) -> None
Sends a form to the player.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form
|
MessageForm | ActionForm | ModalForm
|
The form to send. |
required |
send_map
¶
send_map(map: MapView) -> None
Render a map and send it to the player in its entirety.
This may be used when streaming the map in the normal manner is not desirable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
map
|
MapView
|
The map to send. |
required |
send_packet
¶
send_popup
¶
send_popup(message: str) -> None
Sends this player a popup message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Message to be displayed. |
required |
send_tip
¶
send_tip(message: str) -> None
Sends this player a tip message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Message to be displayed. |
required |
send_title
¶
send_title(
title: str,
subtitle: str,
fade_in: int = 10,
stay: int = 70,
fade_out: int = 20,
) -> None
Sends a title and a subtitle message to the player.
If they are empty strings, the display will be updated as such.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Title text. |
required |
subtitle
|
str
|
Subtitle text. |
required |
fade_in
|
int
|
Time in ticks for titles to fade in. Defaults to 10. |
10
|
stay
|
int
|
Time in ticks for titles to stay. Defaults to 70. |
70
|
fade_out
|
int
|
Time in ticks for titles to fade out. Defaults to 20. |
20
|
send_toast
¶
stop_sound
¶
stop_sound(sound: str) -> None
Stop the specified sound from playing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sound
|
str
|
The sound to stop. |
required |
transfer
¶
update_commands
¶
Send the list of commands to the client.
Generally useful to ensure the client has a complete list of commands after permission changes are done.
endstone.OfflinePlayer
¶
Represents a reference to a player identity and the data belonging to a player that is stored on the disk and can, thus, be retrieved without the player needing to be online.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of this player. |
unique_id |
UUID
|
The UUID of this player. |
endstone.Skin
¶
Skin(
id: str,
image: ndarray[uint8],
cape_id: str | None = None,
cape_image: ndarray[uint8] | None = None,
)