Skip to content

Event

endstone.event

Classes:

Name Description
ActorDeathEvent

Called when an Actor dies.

ActorEvent

Represents an Actor-related event.

ActorKnockbackEvent

Called when a living entity receives knockback.

ActorRemoveEvent

Called when an Actor is removed.

ActorSpawnEvent

Called when an Actor is spawned into a world.

ActorTeleportEvent

Called when a non-player entity is teleported from one location to another.

BlockBreakEvent

Called when a block is broken by a player.

BlockEvent

Represents an Block-related event

BlockPlaceEvent

Called when a block is placed by a player.

BroadcastMessageEvent

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

Event

Represents an event.

EventPriority

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

PlayerChatEvent

Called when a player sends a chat message.

PlayerCommandEvent

Called whenever a player runs a command.

PlayerDeathEvent

Called when a player dies

PlayerEvent

Represents a player related event

PlayerInteractActorEvent

Represents an event that is called when a player right-clicks an actor.

PlayerInteractEvent

Represents an event that is called when a player right-clicks a block.

PlayerJoinEvent

Called when a player joins a server

PlayerKickEvent

Called when a player gets kicked from the server

PlayerLoginEvent

Called when a player attempts to login in.

PlayerQuitEvent

Called when a player leaves a server.

PlayerTeleportEvent

Called when a player is teleported from one location to another.

PluginDisableEvent

Called when a plugin is disabled.

PluginEnableEvent

Called when a plugin is enabled.

ScriptMessageEvent

Called when a message is sent by /scriptevent command

ServerCommandEvent

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

ServerListPingEvent

Called when a server ping is coming in.

ServerLoadEvent

Called when either the server startup or reload has completed.

ThunderChangeEvent

Called when the thunder state in a world is changing.

WeatherChangeEvent

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

Functions:

Name Description
event_handler

ActorDeathEvent

Bases: ActorEvent

Called when an Actor dies.

ActorEvent

Bases: Event

Represents an Actor-related event.

Attributes:

Name Type Description
actor Actor

Returns the Actor involved in this event

actor property

actor: Actor

Returns the Actor involved in this event

ActorKnockbackEvent

Bases: ActorEvent

Called when a living entity receives knockback.

Attributes:

Name Type Description
actor Mob

Returns the Mob involved in this event

knockback Vector

Gets or sets the knockback that will be applied to the entity.

source Actor

Get the source actor that has caused knockback to the defender, if exists.

actor property

actor: Mob

Returns the Mob involved in this event

knockback property writable

knockback: Vector

Gets or sets the knockback that will be applied to the entity.

source property

source: Actor

Get the source actor that has caused knockback to the defender, if exists.

ActorRemoveEvent

Bases: ActorEvent

Called when an Actor is removed.

ActorSpawnEvent

Bases: ActorEvent

Called when an Actor is spawned into a world.

ActorTeleportEvent

Bases: ActorEvent

Called when a non-player entity is teleported from one location to another.

Attributes:

Name Type Description
from_location Location

Gets or sets the location that this actor moved from.

to_location Location

Gets or sets the location that this actor moved to.

from_location property writable

from_location: Location

Gets or sets the location that this actor moved from.

to_location property writable

to_location: Location

Gets or sets the location that this actor moved to.

BlockBreakEvent

Bases: BlockEvent

Called when a block is broken by a player.

Attributes:

Name Type Description
player Player

Gets the Player that is breaking the block involved in this event.

player property

player: Player

Gets the Player that is breaking the block involved in this event.

BlockEvent

Bases: Event

Represents an Block-related event

Attributes:

Name Type Description
block Block

Gets the block involved in this event.

block property

block: Block

Gets the block involved in this event.

BlockPlaceEvent

Bases: BlockEvent

Called when a block is placed by a player.

Attributes:

Name Type Description
block_against Block

Gets the block that this block was placed against

block_placed_state BlockState

Gets the BlockState for the block which was placed.

block_replaced Block

Gets the block which was replaced.

player Player

Gets the player who placed the block involved in this event.

block_against property

block_against: Block

Gets the block that this block was placed against

block_placed_state property

block_placed_state: BlockState

Gets the BlockState for the block which was placed.

block_replaced property

block_replaced: Block

Gets the block which was replaced.

player property

player: Player

Gets the player who placed the block involved in this event.

BroadcastMessageEvent

Bases: Event

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

Attributes:

Name Type Description
message str

Gets or sets the message to broadcast.

recipients set[CommandSender]

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

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.

Attributes:

Name Type Description
asynchronous bool

Whether the event fires asynchronously.

cancellable bool

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

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 str

Gets a user-friendly identifier for this 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

Attributes:

Name Type Description
HIGH EventPriority
HIGHEST EventPriority
LOW EventPriority
LOWEST EventPriority
MONITOR EventPriority
NORMAL EventPriority
name str
value int

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.

Attributes:

Name Type Description
message str

Gets or sets the message that the player will send.

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.

Attributes:

Name Type Description
command str

Gets or sets the command that the player will send.

command property writable

command: str

Gets or sets the command that the player will send.

PlayerDeathEvent

Bases: ActorDeathEvent, PlayerEvent

Called when a player dies

Attributes:

Name Type Description
death_message str

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

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

Attributes:

Name Type Description
player Player

Returns the player involved in this event.

player property

player: Player

Returns the player involved in this event.

PlayerInteractActorEvent

Bases: PlayerEvent

Represents an event that is called when a player right-clicks an actor.

Attributes:

Name Type Description
actor Actor

Gets the actor that was right-clicked by the player.

actor property

actor: Actor

Gets the actor that was right-clicked by the player.

PlayerInteractEvent

Bases: PlayerEvent

Represents an event that is called when a player right-clicks a block.

Attributes:

Name Type Description
block Block

Returns the clicked block

block_face BlockFace

Returns the face of the block that was clicked

clicked_position Vector

Gets the exact position on the block the player interacted with.

has_block bool

Check if this event involved a block

has_item bool

Check if this event involved an item

item ItemStack

Returns the item in hand represented by this event

block property

block: Block

Returns the clicked block

block_face property

block_face: BlockFace

Returns the face of the block that was clicked

clicked_position property

clicked_position: Vector

Gets the exact position on the block the player interacted with.

has_block property

has_block: bool

Check if this event involved a block

has_item property

has_item: bool

Check if this event involved an item

item property

item: ItemStack

Returns the item in hand represented by this event

PlayerJoinEvent

Bases: PlayerEvent

Called when a player joins a server

Attributes:

Name Type Description
join_message str

Gets or sets the join message to send to all online players.

join_message property writable

join_message: str

Gets or sets the join message to send to all online players.

PlayerKickEvent

Bases: PlayerEvent

Called when a player gets kicked from the server

Attributes:

Name Type Description
reason str

Gets or sets the reason why the player is getting kicked

reason property writable

reason: str

Gets or sets the reason why the player is getting kicked

PlayerLoginEvent

Bases: PlayerEvent

Called when a player attempts to login in.

Attributes:

Name Type Description
kick_message str

Gets or sets kick message to display if event is cancelled

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.

Attributes:

Name Type Description
quit_message str

Gets or sets the quit message to send to all online players.

quit_message property writable

quit_message: str

Gets or sets the quit message to send to all online players.

PlayerTeleportEvent

Bases: PlayerEvent

Called when a player is teleported from one location to another.

Attributes:

Name Type Description
from_location Location

Gets or sets the location that this player moved from.

to_location Location

Gets or sets the location that this player moved to.

from_location property writable

from_location: Location

Gets or sets the location that this player moved from.

to_location property writable

to_location: Location

Gets or sets the location that this player moved to.

PluginDisableEvent

Bases: Event

Called when a plugin is disabled.

Attributes:

Name Type Description
plugin Plugin

plugin property

plugin: Plugin

PluginEnableEvent

Bases: Event

Called when a plugin is enabled.

Attributes:

Name Type Description
plugin Plugin

plugin property

plugin: Plugin

ScriptMessageEvent

Bases: Event

Called when a message is sent by /scriptevent command

Attributes:

Name Type Description
message str

Get the message to send.

message_id str

Get the message id to send.

sender CommandSender

Gets the command sender who initiated the command.

message property

message: str

Get the message to send.

message_id property

message_id: str

Get the message id to send.

sender property

sender: CommandSender

Gets the command sender who initiated the command.

ServerCommandEvent

Bases: Event

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

Attributes:

Name Type Description
command str

Gets or sets the command that the server will execute

sender CommandSender

Get the command sender.

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.

Attributes:

Name Type Description
game_mode GameMode

Gets or sets the current game mode.

level_name str

Gets or sets the level name.

local_port int

Get the local port of the server.

local_port_v6 int

Get the local port of the server for IPv6 support

max_players int

Gets or sets the maximum number of players allowed.

minecraft_version_network str

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

motd str

Gets or sets the message of the day message.

network_protocol_version int

Get the network protocol version of this server

num_players int

Gets or sets the number of players online.

remote_host str

Get the host the ping is coming from.

remote_port int

Get the port the ping is coming from.

server_guid str

Get the unique identifier of the server.

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.

Classes:

Name Description
LoadType

Attributes:

Name Type Description
STARTUP LoadType
type LoadType

STARTUP class-attribute

STARTUP: LoadType

type property

type: LoadType

LoadType

LoadType(value: int)

Attributes:

Name Type Description
STARTUP LoadType
name str
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.

Attributes:

Name Type Description
level Level

Returns the Level where this event is occurring

to_thunder_state bool

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

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.

Attributes:

Name Type Description
level Level

Returns the Level where this event is occurring

to_weather_state bool

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

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 = NORMAL,
    ignore_cancelled: bool = False
)