Skip to content

Event

endstone.event

ActorDeathEvent

Bases: ActorEvent

Called when an Actor dies.

ActorEvent

Bases: Event

Represents an Actor-related event.

actor property

actor: Actor

Returns the Actor involved in this event

ActorRemoveEvent

Bases: ActorEvent

Called when an Actor is removed.

ActorSpawnEvent

Bases: ActorEvent

Called when an Actor is spawned into a world.

BroadcastMessageEvent

Bases: Event

Event triggered for server broadcast messages such as from Server.broadcast

message property writable

message: str

Gets or sets the message to broadcast.

recipients property

recipients: set[CommandSender]

Gets a set of recipients that this broadcast message will be displayed to.

Event

Represents an event.

asynchronous property

asynchronous: bool

Whether the event fires asynchronously.

cancellable property

cancellable: bool

Whether the event can be cancelled by a plugin or the server.

cancelled property writable

cancelled: bool

Gets or sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

event_name property

event_name: str

Gets a user-friendly identifier for this event.

EventPriority

EventPriority(value: int)

Listeners are called in following order: LOWEST -> LOW -> NORMAL -> HIGH -> HIGHEST -> MONITOR

HIGH class-attribute

HIGHEST class-attribute

HIGHEST: EventPriority

LOW class-attribute

LOWEST class-attribute

LOWEST: EventPriority

MONITOR class-attribute

MONITOR: EventPriority

NORMAL class-attribute

NORMAL: EventPriority

name property

name: str

value property

value: int

PlayerChatEvent

Bases: PlayerEvent

Called when a player sends a chat message.

message property writable

message: str

Gets or sets the message that the player will send.

PlayerCommandEvent

Bases: PlayerEvent

Called whenever a player runs a command.

command property writable

command: str

Gets or sets the command that the player will send.

PlayerDeathEvent

Bases: ActorDeathEvent, PlayerEvent

Called when a player dies

death_message property writable

death_message: str

Gets or sets the death message that will appear to everyone on the server.

PlayerEvent

Bases: Event

Represents a player related event

player property

player: Player

Returns the player involved in this event.

PlayerJoinEvent

Bases: PlayerEvent

Called when a player joins a server

PlayerLoginEvent

Bases: PlayerEvent

Called when a player attempts to login in.

kick_message property writable

kick_message: str

Gets or sets kick message to display if event is cancelled

PlayerQuitEvent

Bases: PlayerEvent

Called when a player leaves a server.

PluginDisableEvent

Bases: Event

Called when a plugin is disabled.

plugin property

plugin: Plugin

PluginEnableEvent

Bases: Event

Called when a plugin is enabled.

plugin property

plugin: Plugin

ServerCommandEvent

Bases: Event

Called when the console runs a command, early in the process.

command property writable

command: str

Gets or sets the command that the server will execute

sender property

sender: CommandSender

Get the command sender.

ServerListPingEvent

Bases: Event

Called when a server ping is coming in.

game_mode property writable

game_mode: GameMode

Gets or sets the current game mode.

level_name property writable

level_name: str

Gets or sets the level name.

local_port property

local_port: int

Get the local port of the server.

local_port_v6 property

local_port_v6: int

Get the local port of the server for IPv6 support

max_players property writable

max_players: int

Gets or sets the maximum number of players allowed.

minecraft_version_network property writable

minecraft_version_network: str

Gets or sets the network version of Minecraft that is supported by this server

motd property writable

motd: str

Gets or sets the message of the day message.

network_protocol_version property

network_protocol_version: int

Get the network protocol version of this server

num_players property writable

num_players: int

Gets or sets the number of players online.

remote_host property

remote_host: str

Get the host the ping is coming from.

remote_port property

remote_port: int

Get the port the ping is coming from.

server_guid property

server_guid: str

Get the unique identifier of the server.

ServerLoadEvent

Bases: Event

Called when either the server startup or reload has completed.

STARTUP class-attribute

STARTUP: LoadType

type property

type: LoadType

LoadType

LoadType(value: int)
STARTUP class-attribute
STARTUP: LoadType
name property
name: str
value property
value: int

ThunderChangeEvent

Bases: Event

Called when the thunder state in a world is changing.

level property

level: Level

Returns the Level where this event is occurring

to_thunder_state property

to_thunder_state: bool

Gets the state of thunder that the world is being set to

WeatherChangeEvent

Bases: Event

Called when the weather (rain) state in a world is changing.

level property

level: Level

Returns the Level where this event is occurring

to_weather_state property

to_weather_state: bool

Gets the state of weather that the world is being set to

event_handler

event_handler(
    func=None,
    *,
    priority: EventPriority = EventPriority.NORMAL,
    ignore_cancelled: bool = False
)