endstone.event

Classes relating to handling triggered code executions.

Classes relating to handling triggered code executions.

Classes

NameDescription
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

BlockExplodeEvent

Called when a block explodes.

BlockFormEvent

Called when a block is formed or spreads based on world conditions. If a Block Form event is cancelled, the block will not be formed.

BlockFromToEvent

Represents events with a source block and a destination block, currently only applies to liquid (lava and water) and teleporting dragon eggs. If a Block From To event is cancelled, the block will not move (the liquid will not flow).

BlockGrowEvent

Called when a block grows naturally in the world. If a Block Grow event is cancelled, the block will not grow.

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. If a Leaves Decay event is cancelled, the leaves will not decay.

LevelEvent

Represents events within a level

MapInitializeEvent

Called when a map is initialized.

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

PlayerDimensionChangeEvent

Called when a player switches to another dimension.

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 interacts with an object or air.

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.

PlayerPortalEvent

Called when a player is about to teleport because it is in contact with a portal.

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

Functions

NameDescription
event_handler

classActorDamageEvent

Bases: MobEvent, Cancellable

ActorDamageEvent()

Called when an Actor is damaged.

Attributes

NameTypeDescription
damagefloat

Gets or sets the amount of damage caused by the event

damage_sourceDamageSource

Gets the source of damage.

attrdamageproperty

damage: float

Gets or sets the amount of damage caused by the event

attrdamage_sourceproperty

damage_source: DamageSource

Gets the source of damage.

classActorDeathEvent

Bases: MobEvent

ActorDeathEvent()

Called when an Actor dies.

Attributes

NameTypeDescription
damage_sourceDamageSource

Gets the source of damage which caused the death.

attrdamage_sourceproperty

damage_source: DamageSource

Gets the source of damage which caused the death.

classActorEvent

Bases: Event

ActorEvent()

Represents an Actor-related event.

Attributes

NameTypeDescription
actorActor

Returns the Actor involved in this event

attractorproperty

actor: Actor

Returns the Actor involved in this event

classActorExplodeEvent

Bases: ActorEvent, Cancellable

ActorExplodeEvent()

Called when an Actor explodes.

Attributes

NameTypeDescription
block_listlist[Block]

Gets or sets the list of blocks that would have been removed or were removed from the explosion event.

locationLocation

Returns the location where the explosion happened.

attrblock_listproperty

block_list: list[Block]

Gets or sets the list of blocks that would have been removed or were removed from the explosion event.

attrlocationproperty

location: Location

Returns the location where the explosion happened.

classActorKnockbackEvent

Bases: MobEvent, Cancellable

ActorKnockbackEvent()

Called when a living entity receives knockback.

Attributes

NameTypeDescription
knockbackVector

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

sourceActor

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

attrknockbackproperty

knockback: Vector

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

attrsourceproperty

source: Actor

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

classActorRemoveEvent

Bases: ActorEvent

ActorRemoveEvent()

Called when an Actor is removed.

classActorSpawnEvent

Bases: ActorEvent, Cancellable

ActorSpawnEvent()

Called when an Actor is spawned into a world.

classActorTeleportEvent

Bases: ActorEvent, Cancellable

ActorTeleportEvent()

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

Attributes

NameTypeDescription
from_locationLocation

Gets or sets the location that this actor moved from.

to_locationLocation

Gets or sets the location that this actor moved to.

attrfrom_locationproperty

from_location: Location

Gets or sets the location that this actor moved from.

attrto_locationproperty

to_location: Location

Gets or sets the location that this actor moved to.

classBlockBreakEvent

Bases: BlockEvent, Cancellable

BlockBreakEvent()

Called when a block is broken by a player.

Attributes

NameTypeDescription
playerPlayer

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

attrplayerproperty

player: Player

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

classBlockCookEvent

Bases: BlockEvent, Cancellable

BlockCookEvent()

Called when an ItemStack is successfully cooked in a block.

Attributes

NameTypeDescription
resultItemStack

Gets or sets the resultant ItemStack for this event

sourceItemStack

Gets the smelted ItemStack for this event

attrresultproperty

result: ItemStack

Gets or sets the resultant ItemStack for this event

attrsourceproperty

source: ItemStack

Gets the smelted ItemStack for this event

classBlockEvent

Bases: Event

BlockEvent()

Represents an Block-related event

Attributes

NameTypeDescription
blockBlock

Gets the block involved in this event.

attrblockproperty

block: Block

Gets the block involved in this event.

classBlockExplodeEvent

Bases: BlockEvent, Cancellable

BlockExplodeEvent()

Called when a block explodes.

Attributes

NameTypeDescription
block_listlist[Block]

Gets or sets the list of blocks that would have been removed or were removed from the explosion event.

attrblock_listproperty

block_list: list[Block]

Gets or sets the list of blocks that would have been removed or were removed from the explosion event.

classBlockFormEvent

Bases: BlockGrowEvent

BlockFormEvent()

Called when a block is formed or spreads based on world conditions. If a Block Form event is cancelled, the block will not be formed.

classBlockFromToEvent

Bases: BlockEvent, Cancellable

BlockFromToEvent()

Represents events with a source block and a destination block, currently only applies to liquid (lava and water) and teleporting dragon eggs. If a Block From To event is cancelled, the block will not move (the liquid will not flow).

Attributes

NameTypeDescription
to_blockBlock

Gets the faced Block.

attrto_blockproperty

to_block: Block

Gets the faced Block.

classBlockGrowEvent

Bases: BlockEvent, Cancellable

BlockGrowEvent()

Called when a block grows naturally in the world. If a Block Grow event is cancelled, the block will not grow.

Attributes

NameTypeDescription
new_stateBlockState

Gets the state of the block where it will form or spread to.

attrnew_stateproperty

new_state: BlockState

Gets the state of the block where it will form or spread to.

classBlockPistonEvent

Bases: BlockEvent, Cancellable

BlockPistonEvent()

Called when a piston block is triggered

Attributes

NameTypeDescription
directionBlockFace

Return the direction in which the piston will operate.

attrdirectionproperty

direction: BlockFace

Return the direction in which the piston will operate.

classBlockPistonExtendEvent

Bases: BlockPistonEvent

BlockPistonExtendEvent()

Called when a piston extends.

classBlockPistonRetractEvent

Bases: BlockPistonEvent

BlockPistonRetractEvent()

Called when a piston retracts.

classBlockPlaceEvent

Bases: BlockEvent, Cancellable

BlockPlaceEvent()

Called when a block is placed by a player.

Attributes

NameTypeDescription
block_againstBlock

Gets the block that this block was placed against

block_placed_stateBlockState

Gets the BlockState for the block which was placed.

block_replacedBlock

Gets the block which was replaced.

playerPlayer

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

attrblock_againstproperty

block_against: Block

Gets the block that this block was placed against

attrblock_placed_stateproperty

block_placed_state: BlockState

Gets the BlockState for the block which was placed.

attrblock_replacedproperty

block_replaced: Block

Gets the block which was replaced.

attrplayerproperty

player: Player

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

classBroadcastMessageEvent

Bases: ServerEvent, Cancellable

BroadcastMessageEvent()

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

Attributes

NameTypeDescription
messagestr | Translatable

Gets or sets the message to broadcast.

recipientsset[CommandSender]

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

attrmessageproperty

message: str | Translatable

Gets or sets the message to broadcast.

attrrecipientsproperty

recipients: set[CommandSender]

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

classCancellable

Cancellable()

Represents an event that may be cancelled by a plugin or the server.

Methods

NameDescription
cancel

Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Attributes

NameTypeDescription
cancelledbool

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_cancelledbool

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.

attrcancelledproperty

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.

attris_cancelledproperty

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.

methcancel

cancel() -> None

Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

classChunkEvent

Bases: DimensionEvent

ChunkEvent()

Represents a Chunk related event

Attributes

NameTypeDescription
chunkChunk

Gets the chunk being loaded/unloaded

attrchunkproperty

chunk: Chunk

Gets the chunk being loaded/unloaded

classChunkLoadEvent

Bases: ChunkEvent

ChunkLoadEvent()

Called when a chunk is loaded

classChunkUnloadEvent

Bases: ChunkEvent

ChunkUnloadEvent()

Called when a chunk is unloaded

classDimensionEvent

Bases: LevelEvent

DimensionEvent()

Represents events within a dimension

Attributes

NameTypeDescription
dimensionDimension

Gets the dimension primarily involved with this event

attrdimensionproperty

dimension: Dimension

Gets the dimension primarily involved with this event

classEvent

Event()

Represents an event.

Attributes

NameTypeDescription
event_namestr

Gets a user-friendly identifier for this event.

is_asynchronousbool

Whether the event fires asynchronously.

attrevent_nameproperty

event_name: str

Gets a user-friendly identifier for this event.

attris_asynchronousproperty

is_asynchronous: bool

Whether the event fires asynchronously.

classEventPriority

Bases: IntEnum

EventPriority()

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

Attributes

NameTypeDescription
HIGH

Event call is of high importance

HIGHEST

Event call is critical and must have the final say in what happens to the event

LOW

Event call is of low importance

LOWEST

Event call is of very low importance and should be run first, to allow other plugins to further customise the outcome

MONITOR

Event is listened to purely for monitoring the outcome of an event. No modifications to the event should be made under this priority.

NORMAL

Event call is neither important nor unimportant, and may be run normally

attrHIGH

HIGH = 3

Event call is of high importance

attrHIGHEST

HIGHEST = 4

Event call is critical and must have the final say in what happens to the event

attrLOW

LOW = 1

Event call is of low importance

attrLOWEST

LOWEST = 0

Event call is of very low importance and should be run first, to allow other plugins to further customise the outcome

attrMONITOR

MONITOR = 5

Event is listened to purely for monitoring the outcome of an event. No modifications to the event should be made under this priority.

attrNORMAL

NORMAL = 2

Event call is neither important nor unimportant, and may be run normally

classEventResult

Bases: Enum

EventResult()

Attributes

NameTypeDescription
ALLOW
DEFAULT
DENY

attrALLOW

ALLOW = 2

attrDEFAULT

DEFAULT = 1

attrDENY

DENY = 0

classLeavesDecayEvent

Bases: BlockEvent, Cancellable

LeavesDecayEvent()

Called when leaves are decaying naturally. If a Leaves Decay event is cancelled, the leaves will not decay.

classLevelEvent

Bases: Event

LevelEvent()

Represents events within a level

Attributes

NameTypeDescription
levelLevel

Gets the level primarily involved with this event

attrlevelproperty

level: Level

Gets the level primarily involved with this event

classMapInitializeEvent

Bases: ServerEvent

MapInitializeEvent()

Called when a map is initialized.

Attributes

NameTypeDescription
mapMapView

Gets the map initialized in this event.

attrmapproperty

map: MapView

Gets the map initialized in this event.

classMobEvent

Bases: Event

MobEvent()

Represents an Mob-related event.

Attributes

NameTypeDescription
actorMob

Returns the Mob involved in this event

attractorproperty

actor: Mob

Returns the Mob involved in this event

classPacketReceiveEvent

Bases: ServerEvent, Cancellable

PacketReceiveEvent()

Called when the server receives a packet from a connected client.

Attributes

NameTypeDescription
addressSocketAddress

Gets the network address to which this packet is being sent.

packet_idint

Gets the ID of the packet.

payloadbytes

Gets or sets the raw packet data excluding the header.

playerPlayer

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_idint

Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients).

attraddressproperty

address: SocketAddress

Gets the network address to which this packet is being sent.

attrpacket_idproperty

packet_id: int

Gets the ID of the packet.

attrpayloadproperty

payload: bytes

Gets or sets the raw packet data excluding the header.

attrplayerproperty

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.

attrsub_client_idproperty

sub_client_id: int

Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients).

classPacketSendEvent

Bases: ServerEvent, Cancellable

PacketSendEvent()

Called when the server sends a packet to a connected client.

Attributes

NameTypeDescription
addressSocketAddress

Gets the network address to which this packet is being sent.

packet_idint

Gets the ID of the packet.

payloadbytes

Gets or sets the raw packet data excluding the header.

playerPlayer

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_idint

Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients).

attraddressproperty

address: SocketAddress

Gets the network address to which this packet is being sent.

attrpacket_idproperty

packet_id: int

Gets the ID of the packet.

attrpayloadproperty

payload: bytes

Gets or sets the raw packet data excluding the header.

attrplayerproperty

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.

attrsub_client_idproperty

sub_client_id: int

Gets the SubClient ID (0 = primary client; 1-3 = split-screen clients).

classPlayerBedEnterEvent

Bases: PlayerEvent, Cancellable

PlayerBedEnterEvent()

Called when a player is almost about to enter the bed.

Attributes

NameTypeDescription
bedBlock

Returns the bed block involved in this event.

attrbedproperty

bed: Block

Returns the bed block involved in this event.

classPlayerBedLeaveEvent

Bases: PlayerEvent

PlayerBedLeaveEvent()

Called when a player is leaving a bed.

Attributes

NameTypeDescription
bedBlock

Returns the bed block involved in this event.

attrbedproperty

bed: Block

Returns the bed block involved in this event.

classPlayerChatEvent

Bases: PlayerEvent, Cancellable

PlayerChatEvent()

Called when a player sends a chat message.

Attributes

NameTypeDescription
formatstr

Sets the format to use to display this chat message

messagestr

Gets or sets the message that the player will send.

playerPlayer

Gets or sets the player that this message will display as

recipientslist[Player]

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

attrformatproperty

format: str

Sets the format to use to display this chat message

attrmessageproperty

message: str

Gets or sets the message that the player will send.

attrplayerproperty

player: Player

Gets or sets the player that this message will display as

attrrecipientsproperty

recipients: list[Player]

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

classPlayerCommandEvent

Bases: PlayerEvent, Cancellable

PlayerCommandEvent()

Called whenever a player runs a command.

Attributes

NameTypeDescription
commandstr

Gets or sets the command that the player will send.

attrcommandproperty

command: str

Gets or sets the command that the player will send.

classPlayerDeathEvent

Bases: ActorDeathEvent

PlayerDeathEvent()

Called when a player dies

Attributes

NameTypeDescription
death_messagestr | Translatable | None

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

playerPlayer

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

attrdeath_messageproperty

death_message: str | Translatable | None

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

attrplayerproperty

player: Player

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

classPlayerDimensionChangeEvent

Bases: PlayerEvent

PlayerDimensionChangeEvent()

Called when a player switches to another dimension.

Attributes

NameTypeDescription
from_dimensionDimension

Gets the dimension the player is switching from.

to_dimensionDimension

Gets the dimension the player is switching to.

attrfrom_dimensionproperty

from_dimension: Dimension

Gets the dimension the player is switching from.

attrto_dimensionproperty

to_dimension: Dimension

Gets the dimension the player is switching to.

classPlayerDropItemEvent

Bases: PlayerEvent, Cancellable

PlayerDropItemEvent()

Called when a player drops an item from their inventory

Attributes

NameTypeDescription
itemItemStack

Gets the ItemStack dropped by the player

attritemproperty

item: ItemStack

Gets the ItemStack dropped by the player

classPlayerEmoteEvent

Bases: PlayerEvent, Cancellable

PlayerEmoteEvent()

Called when a player uses and emote

Attributes

NameTypeDescription
emote_idstr

Gets the emote piece ID

is_mutedbool

Gets or sets the muted state for the emote.

attremote_idproperty

emote_id: str

Gets the emote piece ID

attris_mutedproperty

is_muted: bool

Gets or sets the muted state for the emote.

classPlayerEvent

Bases: Event

PlayerEvent()

Represents a player related event

Attributes

NameTypeDescription
playerPlayer

Returns the player involved in this event.

attrplayerproperty

player: Player

Returns the player involved in this event.

classPlayerGameModeChangeEvent

Bases: PlayerEvent, Cancellable

PlayerGameModeChangeEvent()

Called when the GameMode of the player is changed.

Attributes

NameTypeDescription
new_game_modeGameMode

Gets the GameMode the player is switched to.

attrnew_game_modeproperty

new_game_mode: GameMode

Gets the GameMode the player is switched to.

classPlayerInteractActorEvent

Bases: PlayerEvent, Cancellable

PlayerInteractActorEvent()

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

Attributes

NameTypeDescription
actorActor

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

attractorproperty

actor: Actor

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

classPlayerInteractEvent

Bases: PlayerEvent, Cancellable

PlayerInteractEvent()

Represents an event that is called when a player interacts with an object or air.

Classes

NameDescription
Action

Attributes

NameTypeDescription
LEFT_CLICK_AIR
LEFT_CLICK_BLOCK
RIGHT_CLICK_AIR
RIGHT_CLICK_BLOCK
actionAction

Returns the action type of interaction

blockBlock

Returns the clicked block

block_faceBlockFace

Returns the face of the block that was clicked

clicked_positionVector | None

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

has_blockbool

Check if this event involved a block

has_itembool

Check if this event involved an item

itemItemStack | None

Returns the item in hand represented by this event

attrLEFT_CLICK_AIR

LEFT_CLICK_AIR

attrLEFT_CLICK_BLOCK

LEFT_CLICK_BLOCK

attrRIGHT_CLICK_AIR

RIGHT_CLICK_AIR

attrRIGHT_CLICK_BLOCK

RIGHT_CLICK_BLOCK

attractionproperty

action: Action

Returns the action type of interaction

attrblockproperty

block: Block

Returns the clicked block

attrblock_faceproperty

block_face: BlockFace

Returns the face of the block that was clicked

attrclicked_positionproperty

clicked_position: Vector | None

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

attrhas_blockproperty

has_block: bool

Check if this event involved a block

attrhas_itemproperty

has_item: bool

Check if this event involved an item

attritemproperty

item: ItemStack | None

Returns the item in hand represented by this event

classAction

Bases: Enum

Action()

attrLEFT_CLICK_AIR

LEFT_CLICK_AIR = 2

attrLEFT_CLICK_BLOCK

LEFT_CLICK_BLOCK = 0

attrRIGHT_CLICK_AIR

RIGHT_CLICK_AIR = 3

attrRIGHT_CLICK_BLOCK

RIGHT_CLICK_BLOCK = 1

classPlayerItemConsumeEvent

Bases: PlayerEvent, Cancellable

PlayerItemConsumeEvent()

Called when a player is finishing consuming an item (food, potion, milk bucket).

Attributes

NameTypeDescription
handEquipmentSlot

Get the hand used to consume the item.

itemItemStack

Gets the item that is being consumed.

attrhandproperty

Get the hand used to consume the item.

attritemproperty

item: ItemStack

Gets the item that is being consumed.

classPlayerItemHeldEvent

Bases: PlayerEvent, Cancellable

PlayerItemHeldEvent()

Called when a player changes their currently held item.

Attributes

NameTypeDescription
new_slotint

Gets the new held slot index

previous_slotint

Gets the previous held slot index.

attrnew_slotproperty

new_slot: int

Gets the new held slot index

attrprevious_slotproperty

previous_slot: int

Gets the previous held slot index.

classPlayerJoinEvent

Bases: PlayerEvent

PlayerJoinEvent()

Called when a player joins a server

Attributes

NameTypeDescription
join_messagestr | Translatable | None

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

attrjoin_messageproperty

join_message: str | Translatable | None

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

classPlayerJumpEvent

Bases: PlayerMoveEvent

PlayerJumpEvent()

Called when a player jumps.

classPlayerKickEvent

Bases: PlayerEvent, Cancellable

PlayerKickEvent()

Called when a player gets kicked from the server

Attributes

NameTypeDescription
reasonstr

Gets or sets the reason why the player is getting kicked

attrreasonproperty

reason: str

Gets or sets the reason why the player is getting kicked

classPlayerLoginEvent

Bases: PlayerEvent, Cancellable

PlayerLoginEvent()

Called when a player attempts to login in.

Attributes

NameTypeDescription
kick_messagestr

Gets or sets kick message to display if event is cancelled

attrkick_messageproperty

kick_message: str

Gets or sets kick message to display if event is cancelled

classPlayerMoveEvent

Bases: PlayerEvent, Cancellable

PlayerMoveEvent()

Called when a player moves.

Attributes

NameTypeDescription
from_locationLocation

Gets or sets the location that this player moved from.

to_locationLocation

Gets or sets the location that this player moved to.

attrfrom_locationproperty

from_location: Location

Gets or sets the location that this player moved from.

attrto_locationproperty

to_location: Location

Gets or sets the location that this player moved to.

classPlayerPickupItemEvent

Bases: PlayerEvent, Cancellable

PlayerPickupItemEvent()

Called when a player picks an item up from the ground.

Attributes

NameTypeDescription
itemItem

Gets the Item picked up by the entity.

attritemproperty

item: Item

Gets the Item picked up by the entity.

classPlayerPortalEvent

Bases: PlayerTeleportEvent

PlayerPortalEvent()

Called when a player is about to teleport because it is in contact with a portal.

classPlayerQuitEvent

Bases: PlayerEvent

PlayerQuitEvent()

Called when a player leaves a server.

Attributes

NameTypeDescription
quit_messagestr | Translatable | None

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

attrquit_messageproperty

quit_message: str | Translatable | None

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

classPlayerRespawnEvent

Bases: PlayerEvent

PlayerRespawnEvent()

Called when a player respawns.

classPlayerSkinChangeEvent

Bases: PlayerEvent, Cancellable

PlayerSkinChangeEvent()

Called when a player changes their skin.

Attributes

NameTypeDescription
new_skinSkin

Gets the player's new skin.

skin_change_messagestr | Translatable | None

Gets or sets the message to send to all online players for this skin change.

attrnew_skinproperty

new_skin: Skin

Gets the player's new skin.

attrskin_change_messageproperty

skin_change_message: str | Translatable | None

Gets or sets the message to send to all online players for this skin change.

classPlayerTeleportEvent

Bases: PlayerMoveEvent

PlayerTeleportEvent()

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

classPluginDisableEvent

Bases: ServerEvent

PluginDisableEvent()

Called when a plugin is disabled.

Attributes

NameTypeDescription
pluginPlugin

attrpluginproperty

plugin: Plugin

classPluginEnableEvent

Bases: ServerEvent

PluginEnableEvent()

Called when a plugin is enabled.

Attributes

NameTypeDescription
pluginPlugin

attrpluginproperty

plugin: Plugin

classScriptMessageEvent

Bases: ServerEvent, Cancellable

ScriptMessageEvent()

Called when a message is sent by /scriptevent command

Attributes

NameTypeDescription
messagestr

Get the message to send.

message_idstr

Get the message id to send.

senderCommandSender

Gets the command sender who initiated the command.

attrmessageproperty

message: str

Get the message to send.

attrmessage_idproperty

message_id: str

Get the message id to send.

attrsenderproperty

Gets the command sender who initiated the command.

classServerCommandEvent

Bases: ServerEvent, Cancellable

ServerCommandEvent()

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

Attributes

NameTypeDescription
commandstr

Gets or sets the command that the server will execute

senderCommandSender

Get the command sender.

attrcommandproperty

command: str

Gets or sets the command that the server will execute

attrsenderproperty

Get the command sender.

classServerEvent

Bases: Event

ServerEvent()

Represents a server-related event

classServerListPingEvent

Bases: ServerEvent, Cancellable

ServerListPingEvent()

Called when a server ping is coming in.

Attributes

NameTypeDescription
addressSocketAddress

Get the address the ping is coming from.

game_modeGameMode

Gets or sets the current game mode.

level_namestr

Gets or sets the level name.

local_portint

Get or set the local port of the server.

local_port_v6int

Get or set the local port of the server for IPv6 support

max_playersint

Gets or sets the maximum number of players allowed.

minecraft_version_networkstr

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

motdstr

Gets or sets the message of the day message.

network_protocol_versionint

Get the network protocol version of this server

num_playersint

Gets or sets the number of players online.

server_guidstr

Get or set the unique identifier of the server.

attraddressproperty

address: SocketAddress

Get the address the ping is coming from.

attrgame_modeproperty

game_mode: GameMode

Gets or sets the current game mode.

attrlevel_nameproperty

level_name: str

Gets or sets the level name.

attrlocal_portproperty

local_port: int

Get or set the local port of the server.

attrlocal_port_v6property

local_port_v6: int

Get or set the local port of the server for IPv6 support

attrmax_playersproperty

max_players: int

Gets or sets the maximum number of players allowed.

attrminecraft_version_networkproperty

minecraft_version_network: str

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

attrmotdproperty

motd: str

Gets or sets the message of the day message.

attrnetwork_protocol_versionproperty

network_protocol_version: int

Get the network protocol version of this server

attrnum_playersproperty

num_players: int

Gets or sets the number of players online.

attrserver_guidproperty

server_guid: str

Get or set the unique identifier of the server.

classServerLoadEvent

Bases: Event

ServerLoadEvent()

Called when either the server startup or reload has completed.

Classes

NameDescription
LoadType

Attributes

NameTypeDescription
STARTUP
typeLoadType

attrSTARTUP

STARTUP

attrtypeproperty

type: LoadType

classLoadType

Bases: Enum

LoadType()

Attributes

NameTypeDescription
STARTUP

attrSTARTUP

STARTUP = 0

classThunderChangeEvent

Bases: WeatherEvent, Cancellable

ThunderChangeEvent()

Called when the thunder state in a world is changing.

Attributes

NameTypeDescription
to_thunder_statebool

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

attrto_thunder_stateproperty

to_thunder_state: bool

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

classWeatherChangeEvent

Bases: WeatherEvent, Cancellable

WeatherChangeEvent()

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

Attributes

NameTypeDescription
to_weather_statebool

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

attrto_weather_stateproperty

to_weather_state: bool

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

classWeatherEvent

Bases: Event

WeatherEvent()

Represents a weather-related event

Attributes

NameTypeDescription
levelLevel

Returns the Level where this event is occurring

attrlevelproperty

level: Level

Returns the Level where this event is occurring

funcevent_handler

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

On this page

classActorDamageEventattrdamageattrdamage_sourceclassActorDeathEventattrdamage_sourceclassActorEventattractorclassActorExplodeEventattrblock_listattrlocationclassActorKnockbackEventattrknockbackattrsourceclassActorRemoveEventclassActorSpawnEventclassActorTeleportEventattrfrom_locationattrto_locationclassBlockBreakEventattrplayerclassBlockCookEventattrresultattrsourceclassBlockEventattrblockclassBlockExplodeEventattrblock_listclassBlockFormEventclassBlockFromToEventattrto_blockclassBlockGrowEventattrnew_stateclassBlockPistonEventattrdirectionclassBlockPistonExtendEventclassBlockPistonRetractEventclassBlockPlaceEventattrblock_againstattrblock_placed_stateattrblock_replacedattrplayerclassBroadcastMessageEventattrmessageattrrecipientsclassCancellableattrcancelledattris_cancelledmethcancelclassChunkEventattrchunkclassChunkLoadEventclassChunkUnloadEventclassDimensionEventattrdimensionclassEventattrevent_nameattris_asynchronousclassEventPriorityattrHIGHattrHIGHESTattrLOWattrLOWESTattrMONITORattrNORMALclassEventResultattrALLOWattrDEFAULTattrDENYclassLeavesDecayEventclassLevelEventattrlevelclassMapInitializeEventattrmapclassMobEventattractorclassPacketReceiveEventattraddressattrpacket_idattrpayloadattrplayerattrsub_client_idclassPacketSendEventattraddressattrpacket_idattrpayloadattrplayerattrsub_client_idclassPlayerBedEnterEventattrbedclassPlayerBedLeaveEventattrbedclassPlayerChatEventattrformatattrmessageattrplayerattrrecipientsclassPlayerCommandEventattrcommandclassPlayerDeathEventattrdeath_messageattrplayerclassPlayerDimensionChangeEventattrfrom_dimensionattrto_dimensionclassPlayerDropItemEventattritemclassPlayerEmoteEventattremote_idattris_mutedclassPlayerEventattrplayerclassPlayerGameModeChangeEventattrnew_game_modeclassPlayerInteractActorEventattractorclassPlayerInteractEventattrLEFT_CLICK_AIRattrLEFT_CLICK_BLOCKattrRIGHT_CLICK_AIRattrRIGHT_CLICK_BLOCKattractionattrblockattrblock_faceattrclicked_positionattrhas_blockattrhas_itemattritemclassActionattrLEFT_CLICK_AIRattrLEFT_CLICK_BLOCKattrRIGHT_CLICK_AIRattrRIGHT_CLICK_BLOCKclassPlayerItemConsumeEventattrhandattritemclassPlayerItemHeldEventattrnew_slotattrprevious_slotclassPlayerJoinEventattrjoin_messageclassPlayerJumpEventclassPlayerKickEventattrreasonclassPlayerLoginEventattrkick_messageclassPlayerMoveEventattrfrom_locationattrto_locationclassPlayerPickupItemEventattritemclassPlayerPortalEventclassPlayerQuitEventattrquit_messageclassPlayerRespawnEventclassPlayerSkinChangeEventattrnew_skinattrskin_change_messageclassPlayerTeleportEventclassPluginDisableEventattrpluginclassPluginEnableEventattrpluginclassScriptMessageEventattrmessageattrmessage_idattrsenderclassServerCommandEventattrcommandattrsenderclassServerEventclassServerListPingEventattraddressattrgame_modeattrlevel_nameattrlocal_portattrlocal_port_v6attrmax_playersattrminecraft_version_networkattrmotdattrnetwork_protocol_versionattrnum_playersattrserver_guidclassServerLoadEventattrSTARTUPattrtypeclassLoadTypeattrSTARTUPclassThunderChangeEventattrto_thunder_stateclassWeatherChangeEventattrto_weather_stateclassWeatherEventattrlevelfuncevent_handler