endstone.event
Classes:
Name | Description |
---|---|
ActorDamageEvent | Called when an Actor is damaged. |
ActorDeathEvent | Called when an Actor dies. |
ActorEvent | Represents an Actor-related event. |
ActorExplodeEvent | Called when an Actor explodes. |
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. |
BlockCookEvent | Called when an ItemStack is successfully cooked in a block. |
BlockEvent | Represents an Block-related event |
BlockPistonEvent | Called when a piston block is triggered |
BlockPistonExtendEvent | Called when a piston extends. |
BlockPistonRetractEvent | Called when a piston retracts. |
BlockPlaceEvent | Called when a block is placed by a player. |
BroadcastMessageEvent | Event triggered for server broadcast messages such as from Server.broadcast |
Cancellable | Represents an event that may be cancelled by a plugin or the server. |
ChunkEvent | Represents a Chunk related event |
ChunkLoadEvent | Called when a chunk is loaded |
ChunkUnloadEvent | Called when a chunk is unloaded |
DimensionEvent | Represents events within a dimension |
Event | Represents an event. |
EventPriority | Listeners are called in following order: LOWEST -> LOW -> NORMAL -> HIGH -> HIGHEST -> MONITOR |
EventResult | |
LeavesDecayEvent | Called when leaves are decaying naturally. |
LevelEvent | Represents events within a level |
MobEvent | Represents an Mob-related event. |
PacketReceiveEvent | Called when the server receives a packet from a connected client. |
PacketSendEvent | Called when the server sends a packet to a connected client. |
PlayerBedEnterEvent | Called when a player is almost about to enter the bed. |
PlayerBedLeaveEvent | Called when a player is leaving a bed. |
PlayerChatEvent | Called when a player sends a chat message. |
PlayerCommandEvent | Called whenever a player runs a command. |
PlayerDeathEvent | Called when a player dies |
PlayerDropItemEvent | Called when a player drops an item from their inventory |
PlayerEmoteEvent | Called when a player uses and emote |
PlayerEvent | Represents a player related event |
PlayerGameModeChangeEvent | Called when the GameMode of the player is changed. |
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. |
PlayerItemConsumeEvent | Called when a player is finishing consuming an item (food, potion, milk bucket). |
PlayerItemHeldEvent | Called when a player changes their currently held item. |
PlayerJoinEvent | Called when a player joins a server |
PlayerJumpEvent | Called when a player jumps. |
PlayerKickEvent | Called when a player gets kicked from the server |
PlayerLoginEvent | Called when a player attempts to login in. |
PlayerMoveEvent | Called when a player moves. |
PlayerPickupItemEvent | Called when a player picks an item up from the ground. |
PlayerQuitEvent | Called when a player leaves a server. |
PlayerRespawnEvent | Called when a player respawns. |
PlayerSkinChangeEvent | Called when a player changes their skin. |
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. |
ServerEvent | Represents a server-related event |
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. |
WeatherEvent | Represents a weather-related event |
Methods:
Name | Description |
---|---|
event_handler |
ActorDamageEvent
Bases: MobEvent
, Cancellable
Called when an Actor is damaged.
Attributes:
Name | Type | Description |
---|---|---|
damage | float | Gets or sets the amount of damage caused by the event |
damage_source | DamageSource | Gets the source of damage. |
damage
damage: float
Gets or sets the amount of damage caused by the event
damage_source
damage_source: DamageSource
Gets the source of damage.
ActorDeathEvent
Bases: MobEvent
Called when an Actor dies.
Attributes:
Name | Type | Description |
---|---|---|
damage_source | DamageSource | Gets the source of damage which caused the death. |
damage_source
damage_source: DamageSource
Gets the source of damage which caused the death.
ActorEvent
Bases: Event
Represents an Actor-related event.
Attributes:
actor
actor: Actor
Returns the Actor involved in this event
ActorExplodeEvent
Bases: ActorEvent
, Cancellable
Called when an Actor explodes.
Attributes:
Name | Type | Description |
---|---|---|
block_list | list[Block] | Gets or sets the list of blocks that would have been removed or were removed from the explosion event. |
location | Location | Returns the location where the explosion happened. |
block_list
block_list: list[Block]
Gets or sets the list of blocks that would have been removed or were removed from the explosion event.
location
location: Location
Returns the location where the explosion happened.
ActorKnockbackEvent
Bases: MobEvent
, Cancellable
Called when a living entity receives knockback.
Attributes:
Name | Type | Description |
---|---|---|
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. |
knockback
knockback: Vector
Gets or sets the knockback that will be applied to the entity.
source
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
, Cancellable
Called when an Actor is spawned into a world.
ActorTeleportEvent
Bases: ActorEvent
, Cancellable
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
from_location: Location
Gets or sets the location that this actor moved from.
to_location
to_location: Location
Gets or sets the location that this actor moved to.
BlockBreakEvent
Bases: BlockEvent
, Cancellable
Called when a block is broken by a player.
Attributes:
player
player: Player
Gets the Player that is breaking the block involved in this event.
BlockCookEvent
Bases: BlockEvent
, Cancellable
Called when an ItemStack is successfully cooked in a block.
Attributes:
Name | Type | Description |
---|---|---|
result | ItemStack | Gets or sets the resultant ItemStack for this event |
source | ItemStack | Gets the smelted ItemStack for this event |
result
result: ItemStack
Gets or sets the resultant ItemStack for this event
source
source: ItemStack
Gets the smelted ItemStack for this event
BlockEvent
Bases: Event
Represents an Block-related event
Attributes:
block
block: Block
Gets the block involved in this event.
BlockPistonEvent
Bases: BlockEvent
, Cancellable
Called when a piston block is triggered
Attributes:
direction
direction: BlockFace
Return the direction in which the piston will operate.
BlockPistonExtendEvent
Bases: BlockPistonEvent
Called when a piston extends.
BlockPistonRetractEvent
Bases: BlockPistonEvent
Called when a piston retracts.
BlockPlaceEvent
Bases: BlockEvent
, Cancellable
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
block_against: Block
Gets the block that this block was placed against
block_placed_state
block_placed_state: BlockState
Gets the BlockState for the block which was placed.
block_replaced
block_replaced: Block
Gets the block which was replaced.
player
player: Player
Gets the player who placed the block involved in this event.
BroadcastMessageEvent
Bases: ServerEvent
, Cancellable
Event triggered for server broadcast messages such as from Server.broadcast
Attributes:
Name | Type | Description |
---|---|---|
message | str | Translatable | Gets or sets the message to broadcast. |
recipients | set[CommandSender] | Gets a set of recipients that this broadcast message will be displayed to. |
message
message: str | Translatable
Gets or sets the message to broadcast.
recipients
recipients: set[CommandSender]
Gets a set of recipients that this broadcast message will be displayed to.
Cancellable
Represents an event that may be cancelled by a plugin or the server.
Methods:
Name | Description |
---|---|
cancel | Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins. |
Attributes:
Name | Type | Description |
---|---|---|
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. [Warning] Deprecated: Use is_cancelled instead. |
is_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. |
cancelled
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. [Warning] Deprecated: Use is_cancelled instead.
is_cancelled
is_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.
cancel
cancel() -> None
Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
ChunkEvent
Bases: DimensionEvent
Represents a Chunk related event
Attributes:
chunk
chunk: Chunk
Gets the chunk being loaded/unloaded
ChunkLoadEvent
Bases: ChunkEvent
Called when a chunk is loaded
ChunkUnloadEvent
Bases: ChunkEvent
Called when a chunk is unloaded
DimensionEvent
Bases: LevelEvent
Represents events within a dimension
Attributes:
dimension
dimension: Dimension
Gets the dimension primarily involved with this event
Event
Represents an event.
Attributes:
Name | Type | Description |
---|---|---|
event_name | str | Gets a user-friendly identifier for this event. |
is_asynchronous | bool | Whether the event fires asynchronously. |
event_name
event_name: str
Gets a user-friendly identifier for this event.
is_asynchronous
is_asynchronous: bool
Whether the event fires asynchronously.
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
HIGH: EventPriority
HIGHEST
HIGHEST: EventPriority
LOW
LOW: EventPriority
LOWEST
LOWEST: EventPriority
MONITOR
MONITOR: EventPriority
NORMAL
NORMAL: EventPriority
name
name: str
value
value: int
EventResult
EventResult(value:int)
Attributes:
Name | Type | Description |
---|---|---|
ALLOW | EventResult | |
DEFAULT | EventResult | |
DENY | EventResult | |
name | str | |
value | int |
ALLOW
ALLOW: EventResult
DEFAULT
DEFAULT: EventResult
DENY
DENY: EventResult
name
name: str
value
value: int
LeavesDecayEvent
Bases: BlockEvent
, Cancellable
Called when leaves are decaying naturally. If a Leaves Decay event is cancelled, the leaves will not decay.
LevelEvent
Bases: Event
Represents events within a level
Attributes:
level
level: Level
Gets the level primarily involved with this event
MobEvent
Bases: Event
Represents an Mob-related event.
Attributes:
actor
actor: Mob
Returns the Mob involved in this event
PacketReceiveEvent
Bases: ServerEvent
, Cancellable
Called when the server receives a packet from a connected client.
Attributes:
Name | Type | Description |
---|---|---|
address | SocketAddress | Gets the network address to which this packet is being sent. |
packet_id | int | Gets the ID of the packet. |
payload | bytes | Gets or sets the raw packet data excluding the header. |
player | Player | Gets the player involved in this event |
sub_client_id | int | Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients). |
address
address: SocketAddress
Gets the network address to which this packet is being sent.
packet_id
packet_id: int
Gets the ID of the packet.
payload
payload: bytes
Gets or sets the raw packet data excluding the header.
player
player: Player
Gets the player involved in this event NOTE: This may return None if the packet is sent before the player completes the login process.
sub_client_id
sub_client_id: int
Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients).
PacketSendEvent
Bases: ServerEvent
, Cancellable
Called when the server sends a packet to a connected client.
Attributes:
Name | Type | Description |
---|---|---|
address | SocketAddress | Gets the network address to which this packet is being sent. |
packet_id | int | Gets the ID of the packet. |
payload | bytes | Gets or sets the raw packet data excluding the header. |
player | Player | Gets the player involved in this event |
sub_client_id | int | Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients). |
address
address: SocketAddress
Gets the network address to which this packet is being sent.
packet_id
packet_id: int
Gets the ID of the packet.
payload
payload: bytes
Gets or sets the raw packet data excluding the header.
player
player: Player
Gets the player involved in this event NOTE: This may return None if the packet is sent before the player completes the login process.
sub_client_id
sub_client_id: int
Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients).
PlayerBedEnterEvent
Bases: PlayerEvent
, Cancellable
Called when a player is almost about to enter the bed.
Attributes:
bed
bed: Block
Returns the bed block involved in this event.
PlayerBedLeaveEvent
Bases: PlayerEvent
Called when a player is leaving a bed.
Attributes:
bed
bed: Block
Returns the bed block involved in this event.
PlayerChatEvent
Bases: PlayerEvent
, Cancellable
Called when a player sends a chat message.
Attributes:
message
message: str
Gets or sets the message that the player will send.
PlayerCommandEvent
Bases: PlayerEvent
, Cancellable
Called whenever a player runs a command.
Attributes:
command
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 | Translatable | None | Gets or sets the death message that will appear to everyone on the server. |
death_message
death_message: str | Translatable | None
Gets or sets the death message that will appear to everyone on the server.
PlayerDropItemEvent
Bases: PlayerEvent
, Cancellable
Called when a player drops an item from their inventory
Attributes:
item
item: ItemStack
Gets the ItemStack dropped by the player
PlayerEmoteEvent
Bases: PlayerEvent
, Cancellable
Called when a player uses and emote
Attributes:
Name | Type | Description |
---|---|---|
emote_id | str | Gets the emote piece ID |
is_muted | bool | Gets or sets the muted state for the emote. |
emote_id
emote_id: str
Gets the emote piece ID
is_muted
is_muted: bool
Gets or sets the muted state for the emote.
PlayerEvent
Bases: Event
Represents a player related event
Attributes:
player
player: Player
Returns the player involved in this event.
PlayerGameModeChangeEvent
Bases: PlayerEvent
, Cancellable
Called when the GameMode of the player is changed.
Attributes:
Name | Type | Description |
---|---|---|
new_game_mode | GameMode | Gets the GameMode the player is switched to. |
new_game_mode
new_game_mode: GameMode
Gets the GameMode the player is switched to.
PlayerInteractActorEvent
Bases: PlayerEvent
, Cancellable
Represents an event that is called when a player right-clicks an actor.
Attributes:
actor
actor: Actor
Gets the actor that was right-clicked by the player.
PlayerInteractEvent
Bases: PlayerEvent
, Cancellable
Represents an event that is called when a player right-clicks a block.
Classes:
Name | Description |
---|---|
Action |
Attributes:
Name | Type | Description |
---|---|---|
action | Action | Returns the action type of interaction |
block | Block | Returns the clicked block |
block_face | BlockFace | Returns the face of the block that was clicked |
clicked_position | Vector | None | 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 |
action
action: PlayerInteractEvent.Action
Returns the action type of interaction
block
block: Block
Returns the clicked block
block_face
block_face: BlockFace
Returns the face of the block that was clicked
clicked_position
clicked_position: Vector | None
Gets the exact position on the block the player interacted with.
has_block
has_block: bool
Check if this event involved a block
has_item
has_item: bool
Check if this event involved an item
item
item: ItemStack
Returns the item in hand represented by this event
Action
Action(value:int)
Attributes:
Name | Type | Description |
---|---|---|
LEFT_CLICK_AIR | Action | |
LEFT_CLICK_BLOCK | Action | |
RIGHT_CLICK_AIR | Action | |
RIGHT_CLICK_BLOCK | Action | |
name | str | |
value | int |
LEFT_CLICK_AIR
LEFT_CLICK_AIR: PlayerInteractEvent.Action
LEFT_CLICK_BLOCK
LEFT_CLICK_BLOCK: PlayerInteractEvent.Action
RIGHT_CLICK_AIR
RIGHT_CLICK_AIR: PlayerInteractEvent.Action
RIGHT_CLICK_BLOCK
RIGHT_CLICK_BLOCK: PlayerInteractEvent.Action
name
name: str
value
value: int
PlayerItemConsumeEvent
Bases: PlayerEvent
, Cancellable
Called when a player is finishing consuming an item (food, potion, milk bucket).
Attributes:
Name | Type | Description |
---|---|---|
hand | EquipmentSlot | Get the hand used to consume the item. |
item | ItemStack | Gets or sets the item that is being consumed. |
hand
hand: EquipmentSlot
Get the hand used to consume the item.
item
item: ItemStack
Gets or sets the item that is being consumed.
PlayerItemHeldEvent
Bases: PlayerEvent
, Cancellable
Called when a player changes their currently held item.
Attributes:
Name | Type | Description |
---|---|---|
new_slot | int | Gets the new held slot index |
previous_slot | int | Gets the previous held slot index. |
new_slot
new_slot: int
Gets the new held slot index
previous_slot
previous_slot: int
Gets the previous held slot index.
PlayerJoinEvent
Bases: PlayerEvent
Called when a player joins a server
Attributes:
Name | Type | Description |
---|---|---|
join_message | str | Translatable | None | Gets or sets the join message to send to all online players. |
join_message
join_message: str | Translatable | None
Gets or sets the join message to send to all online players.
PlayerJumpEvent
Bases: PlayerMoveEvent
Called when a player jumps.
PlayerKickEvent
Bases: PlayerEvent
, Cancellable
Called when a player gets kicked from the server
Attributes:
reason
reason: str
Gets or sets the reason why the player is getting kicked
PlayerLoginEvent
Bases: PlayerEvent
, Cancellable
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
kick_message: str
Gets or sets kick message to display if event is cancelled
PlayerMoveEvent
Bases: PlayerEvent
, Cancellable
Called when a player moves.
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
from_location: Location
Gets or sets the location that this player moved from.
to_location
to_location: Location
Gets or sets the location that this player moved to.
PlayerPickupItemEvent
Bases: PlayerEvent
, Cancellable
Called when a player picks an item up from the ground.
Attributes:
item
item: Item
Gets the Item picked up by the entity.
PlayerQuitEvent
Bases: PlayerEvent
Called when a player leaves a server.
Attributes:
Name | Type | Description |
---|---|---|
quit_message | str | Translatable | None | Gets or sets the quit message to send to all online players. |
quit_message
quit_message: str | Translatable | None
Gets or sets the quit message to send to all online players.
PlayerRespawnEvent
Bases: PlayerEvent
Called when a player respawns.
PlayerSkinChangeEvent
Bases: PlayerEvent
, Cancellable
Called when a player changes their skin.
Attributes:
Name | Type | Description |
---|---|---|
new_skin | Skin | Gets the player’s new skin. |
skin_change_message | str | Translatable | None | Gets or sets the message to send to all online players for this skin change. |
new_skin
new_skin: Skin
Gets the player’s new skin.
skin_change_message
skin_change_message: str | Translatable | None
Gets or sets the message to send to all online players for this skin change.
PlayerTeleportEvent
Bases: PlayerMoveEvent
Called when a player is teleported from one location to another.
PluginDisableEvent
PluginEnableEvent
ScriptMessageEvent
Bases: ServerEvent
, Cancellable
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
message: str
Get the message to send.
message_id
message_id: str
Get the message id to send.
sender
sender: CommandSender
Gets the command sender who initiated the command.
ServerCommandEvent
Bases: ServerEvent
, Cancellable
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
command: str
Gets or sets the command that the server will execute
sender
sender: CommandSender
Get the command sender.
ServerEvent
Bases: Event
Represents a server-related event
ServerListPingEvent
Bases: ServerEvent
, Cancellable
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. |
game_mode
game_mode: GameMode
Gets or sets the current game mode.
level_name
level_name: str
Gets or sets the level name.
local_port
local_port: int
Get or set the local port of the server.
local_port_v6
local_port_v6: int
Get or set the local port of the server for IPv6 support
max_players
max_players: int
Gets or sets the maximum number of players allowed.
minecraft_version_network
minecraft_version_network: str
Gets or sets the network version of Minecraft that is supported by this server
motd
motd: str
Gets or sets the message of the day message.
network_protocol_version
network_protocol_version: int
Get the network protocol version of this server
num_players
num_players: int
Gets or sets the number of players online.
remote_host
remote_host: str
Get the host the ping is coming from.
remote_port
remote_port: int
Get the port the ping is coming from.
server_guid
server_guid: str
Get or set the unique identifier of the server.
ServerLoadEvent
Bases: Event
Called when either the server startup or reload has completed.
Classes:
Name | Description |
---|---|
LoadType |
Attributes:
STARTUP
STARTUP: ServerLoadEvent.LoadType
type
type: ServerLoadEvent.LoadType
LoadType
LoadType(value:int)
ThunderChangeEvent
Bases: WeatherEvent
, Cancellable
Called when the thunder state in a world is changing.
Attributes:
Name | Type | Description |
---|---|---|
to_thunder_state | bool | Gets the state of thunder that the world is being set to |
to_thunder_state
to_thunder_state: bool
Gets the state of thunder that the world is being set to
WeatherChangeEvent
Bases: WeatherEvent
, Cancellable
Called when the weather (rain) state in a world is changing.
Attributes:
Name | Type | Description |
---|---|---|
to_weather_state | bool | Gets the state of weather that the world is being set to |
to_weather_state
to_weather_state: bool
Gets the state of weather that the world is being set to
WeatherEvent
Bases: Event
Represents a weather-related event
Attributes:
level
level: Level
Returns the Level where this event is occurring
event_handler
event_handler(
func=None,
*,
priority: EventPriority = EventPriority.NORMAL,
ignore_cancelled: bool = False
)