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 |
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
¶
ActorEvent
¶
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. |
ActorRemoveEvent
¶
ActorSpawnEvent
¶
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. |
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. |
BlockEvent
¶
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_placed_state
property
¶
block_placed_state: BlockState
Gets the BlockState for the block which was placed.
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. |
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. |
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
|
|
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. |
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. |
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. |
PlayerEvent
¶
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. |
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 |
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. |
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 |
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 |
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. |
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. |
PluginDisableEvent
¶
PluginEnableEvent
¶
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. |
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. |
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 or set the local port of the server. |
local_port_v6 |
int
|
Get or set 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 or set the unique identifier of the server. |
local_port_v6
property
writable
¶
local_port_v6: int
Get or set 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
ServerLoadEvent
¶
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 |
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 |
event_handler
¶
event_handler(
func=None,
*,
priority: EventPriority = NORMAL,
ignore_cancelled: bool = False
)