Skip to content

Event

endstone.event

Classes relating to handling triggered code executions.

Classes:

Name Description
ActorChangeBlockEvent

Called when an Actor changes a block through its own behaviour, such as a creeper exploding, an

ActorCollideWithActorEvent

Called when two actors collide with each other.

ActorDamageEvent

Called when an Actor is damaged.

ActorDeathEvent

Called when an Actor dies.

ActorDismountEvent

Called when an Actor stops riding another Actor.

ActorEffectEvent

Called when an effect on a Mob changes.

ActorEvent

Represents an Actor-related event.

ActorExplodeEvent

Called when an actor explodes.

ActorKnockbackEvent

Called when a living entity receives knockback.

ActorPickupItemEvent

Called when an Actor picks an item up from the ground.

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.

ActorToggleGlideEvent

Called when an Actor's gliding state is toggled with an elytra.

ActorToggleSwimEvent

Called when an Actor's swimming state is toggled.

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 (e.g. bed in the Nether, respawn anchor in the Overworld).

BlockFormEvent

Called when a block is formed or spreads based on world conditions.

BlockFromToEvent

Represents events with a source block and a destination block, currently only applies to liquid

BlockGrowEvent

Called when a block grows naturally in the world.

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.

CauldronLevelChangeEvent

Called when a cauldron's level or contents change.

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.

DimensionLoadEvent

Called when a dimension is loaded.

EnchantItemEvent

Called when a player enchants an item at an enchanting table.

Event

Represents an event.

EventPriority

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

EventResult

Represents the result a plugin can apply to an event whose default behaviour can be allowed, denied, or left to the server.

InventoryCloseEvent

Called when a player closes an inventory.

InventoryEvent

Represents a player related inventory event.

InventoryInteractEvent

An abstract base class for events that describe an interaction between a Player and the contents of an

InventoryOpenEvent

Called when a player opens an inventory.

LeavesDecayEvent

Called when leaves are decaying naturally.

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.

PlayerArmSwingEvent

Called when a player swings their arm.

PlayerArmorStandManipulateEvent

Called when a player interacts with an armor stand and will either swap, retrieve or place an item.

PlayerBedEnterEvent

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

PlayerBedLeaveEvent

Called when a player is leaving a bed.

PlayerBucketActorEvent

Called when a player captures an actor in a bucket.

PlayerBucketEmptyEvent

Called when a player empties a bucket.

PlayerBucketEvent

Base class for events involving a player's bucket interaction.

PlayerBucketFillEvent

Called when a player fills a bucket.

PlayerChatEvent

Called when a player sends a chat message.

PlayerCommandEvent

Called whenever a player runs a command.

PlayerCraftItemEvent

Called when a player crafts an item, either inside a crafting grid or straight from the recipe book.

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.

PlayerEditBookEvent

Called when a player edits or signs a book.

PlayerEmoteEvent

Called when a player uses an emote.

PlayerEvent

Represents a player related event.

PlayerExpChangeEvent

Called when a player's experience changes.

PlayerGameModeChangeEvent

Called when the GameMode of the player is changed.

PlayerHideActorEvent

Called when a visible actor is hidden from a player.

PlayerInputEvent

Called when a player sends updated input to the server.

PlayerInteractActorEvent

Called when a player right-clicks an actor.

PlayerInteractEvent

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.

PlayerLevelChangeEvent

Called when a player's level changes.

PlayerLoginEvent

Called when a player attempts to login in.

PlayerMoveEvent

Called when a player moves.

PlayerOpenSignEvent

Called when a player begins editing a sign's text.

PlayerPickupArrowEvent

Called when a player picks up an arrow or a thrown trident from the ground.

PlayerPickupExperienceEvent

Called when a player picks up an experience orb.

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.

PlayerRecipeBookSettingsChangeEvent

Called when a player changes recipe book settings.

PlayerRespawnEvent

Called when a player respawns.

PlayerRiptideEvent

Called when a player activates the riptide enchantment, using their trident to propel them through the air.

PlayerSetSpawnEvent

Called when a player's spawn is set, either by themselves or otherwise.

PlayerShearActorEvent

Called when a player shears an actor.

PlayerShowActorEvent

Called when a hidden actor is shown to a player.

PlayerSkinChangeEvent

Called when a player changes their skin.

PlayerTeleportEvent

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

PlayerToggleCrawlEvent

Called when a player toggles their crawling state.

PlayerToggleFlightEvent

Called when a player toggles their flying state.

PlayerToggleSneakEvent

Called when a player toggles their sneaking state.

PlayerToggleSprintEvent

Called when a player toggles their sprinting state.

PluginDisableEvent

Called when a plugin is disabled.

PluginEnableEvent

Called when a plugin is enabled.

ScriptMessageEvent

Called when a message is sent by the /scriptevent command.

ServerCommandEvent

Called when a command is run by a non-player, early in the command handling 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.

UnknownCommandEvent

Called when a command sender executes a command that is not defined.

WeatherChangeEvent

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

WeatherEvent

Represents a Weather-related event.

Functions:

Name Description
event_handler

ActorChangeBlockEvent

ActorChangeBlockEvent(is_async: bool = False)

Bases: ActorEvent, Cancellable

Called when an Actor changes a block through its own behaviour, such as a creeper exploding, an enderman picking a block up, a ravager trampling crops or a zombie breaking a door.

Unlike Bukkit's equivalent, this covers only the mob griefing paths. It is not called for falling blocks landing or for sheep eating grass, and the resulting block state is not available.

Attributes:

Name Type Description
block Block

The block that will be changed.

block property

block: Block

The block that will be changed.

ActorCollideWithActorEvent

ActorCollideWithActorEvent(is_async: bool = False)

Bases: Event, Cancellable

Called when two actors collide with each other.

If this event is cancelled, the actors will not be pushed away from each other. Cancelling also stops either actor from being pulled onto the other when the other is a rideable vehicle, so a listener that cancels every collision also stops boats and minecarts from being boarded by walking into them.

The server fires this before it decides whether the collision leads to a push, so it is also called for pairs the server then leaves alone, and it is called more than once per tick for a pair that keeps overlapping.

Attributes:

Name Type Description
actors list[Actor]

The actors that are involved in this event.

actors property

actors: list[Actor]

The actors that are involved in this event.

ActorDamageEvent

ActorDamageEvent(is_async: bool = False)

Bases: MobEvent, Cancellable

Called when an Actor is damaged.

Attributes:

Name Type Description
damage float

The raw amount of damage caused by the event.

damage_source DamageSource

A DamageSource detailing the source of the damage.

damage property writable

damage: float

The raw amount of damage caused by the event.

damage_source property

damage_source: DamageSource

A DamageSource detailing the source of the damage.

ActorDeathEvent

ActorDeathEvent(is_async: bool = False)

Bases: MobEvent

Called when an Actor dies.

Attributes:

Name Type Description
damage_source DamageSource

A DamageSource detailing the source of the damage for the death.

damage_source property

damage_source: DamageSource

A DamageSource detailing the source of the damage for the death.

ActorDismountEvent

ActorDismountEvent(is_async: bool = False)

Bases: ActorEvent, Cancellable

Called when an Actor stops riding another Actor.

Attributes:

Name Type Description
vehicle Actor

The actor that is being dismounted.

vehicle property

vehicle: Actor

The actor that is being dismounted.

ActorEffectEvent

ActorEffectEvent(is_async: bool = False)

Bases: MobEvent, Cancellable

Called when an effect on a Mob changes.

This is fired before the change is applied. Cancelling the event prevents it, and the effect may be replaced with a different one by assigning to effect.

Classes:

Name Description
Action

An enum to specify how the effect changed.

Attributes:

Name Type Description
ADDED
action Action

How the effect changed.

effect Effect

The effect involved in this event.

ADDED class-attribute instance-attribute

ADDED = Action.ADDED

action property

action: Action

How the effect changed.

effect property writable

effect: Effect

The effect involved in this event.

Action

Bases: Enum

An enum to specify how the effect changed.

Attributes:

Name Type Description
ADDED
ADDED class-attribute instance-attribute
ADDED = 0

ActorEvent

ActorEvent(is_async: bool = False)

Bases: Event

Represents an Actor-related event.

Attributes:

Name Type Description
actor Actor

The Actor which is involved in this event.

actor property

actor: Actor

The Actor which is involved in this event.

ActorExplodeEvent

ActorExplodeEvent(is_async: bool = False)

Bases: ActorEvent, Cancellable

Called when an actor explodes.

Attributes:

Name Type Description
block_list list[Block]

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

location Location

The location where the explosion happened.

block_list property writable

block_list: list[Block]

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

location property

location: Location

The location where the explosion happened.

It is not possible to get this value from the Entity as the Entity no longer exists in the world.

ActorKnockbackEvent

ActorKnockbackEvent(is_async: bool = False)

Bases: MobEvent, Cancellable

Called when a living entity receives knockback.

Attributes:

Name Type Description
knockback Vector

The knockback that will be applied to the entity.

source Actor | None

The source actor that has caused knockback to the defender, or None if the knockback is not caused by an actor.

knockback property writable

knockback: Vector

The knockback that will be applied to the entity.

Note: the getter returns a copy; changes must be applied via the setter.

source property

source: Actor | None

The source actor that has caused knockback to the defender, or None if the knockback is not caused by an actor.

ActorPickupItemEvent

ActorPickupItemEvent(is_async: bool = False)

Bases: ActorEvent, Cancellable

Called when an Actor picks an item up from the ground.

This is not called for players; see PlayerPickupItemEvent instead.

Attributes:

Name Type Description
amount int

The number of items that will be picked up from the stack.

item Item

The Item picked up by the actor.

amount property

amount: int

The number of items that will be picked up from the stack.

item property

item: Item

The Item picked up by the actor.

ActorRemoveEvent

ActorRemoveEvent(is_async: bool = False)

Bases: ActorEvent

Called when an Actor is removed.

This event should only be used for monitoring. Modifying the actor during or after this event leads to undefined behaviours. This event will not be called for Players.

ActorSpawnEvent

ActorSpawnEvent(is_async: bool = False)

Bases: ActorEvent, Cancellable

Called when an Actor is spawned into a world.

If an Actor Spawn event is cancelled, the actor will not spawn.

ActorTeleportEvent

ActorTeleportEvent(is_async: bool = False)

Bases: ActorEvent, Cancellable

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

This may be as a result of natural causes (Enderman, Shulker), pathfinding (Wolf), or commands (/teleport).

Attributes:

Name Type Description
from_location Location

The location that this actor moved from.

to_location Location

The location that this actor moved to.

from_location property writable

from_location: Location

The location that this actor moved from.

to_location property writable

to_location: Location

The location that this actor moved to.

ActorToggleGlideEvent

ActorToggleGlideEvent(is_async: bool = False)

Bases: MobEvent

Called when an Actor's gliding state is toggled with an elytra.

Attributes:

Name Type Description
is_gliding bool

Whether the actor is now gliding or not.

is_gliding property

is_gliding: bool

Whether the actor is now gliding or not.

ActorToggleSwimEvent

ActorToggleSwimEvent(is_async: bool = False)

Bases: MobEvent

Called when an Actor's swimming state is toggled.

Attributes:

Name Type Description
is_swimming bool

Whether the actor is now swimming or not.

is_swimming property

is_swimming: bool

Whether the actor is now swimming or not.

BlockBreakEvent

BlockBreakEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when a block is broken by a player.

If a BlockBreakEvent is cancelled, the block will not break and experience will not drop.

Attributes:

Name Type Description
player Player

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

player property

player: Player

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

BlockCookEvent

BlockCookEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when an ItemStack is successfully cooked in a block.

Attributes:

Name Type Description
recipe CookingRecipe | None

The cooking recipe this event is for, or None if the server could not resolve one.

result ItemStack

The resultant ItemStack for this event.

source ItemStack

The smelted (source) ItemStack for this event.

recipe property

recipe: CookingRecipe | None

The cooking recipe this event is for, or None if the server could not resolve one.

result property writable

result: ItemStack

The resultant ItemStack for this event.

source property

source: ItemStack

The smelted (source) ItemStack for this event.

BlockEvent

BlockEvent(is_async: bool = False)

Bases: Event

Represents an Block-related event.

Attributes:

Name Type Description
block Block

The Block which is involved in this event.

block property

block: Block

The Block which is involved in this event.

BlockExplodeEvent

BlockExplodeEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when a block explodes (e.g. bed in the Nether, respawn anchor in the Overworld).

If a BlockExplodeEvent is cancelled, the explosion will not occur.

Attributes:

Name Type Description
block_list list[Block]

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

block_list property writable

block_list: list[Block]

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

BlockFormEvent

BlockFormEvent(is_async: bool = False)

Bases: BlockGrowEvent

Called when a block is formed or spreads based on world conditions.

Use BlockSpreadEvent to catch blocks that actually spread and don't just "randomly" form.

Examples:

  • Snow forming due to a snow storm.
  • Ice forming in a snowy Biome like Taiga or Tundra.
  • Obsidian / Cobblestone forming due to contact with water.
  • Concrete forming due to mixing of concrete powder and water.

If a Block Form event is cancelled, the block will not be formed.

BlockFromToEvent

BlockFromToEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

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:

Name Type Description
to_block Block

The faced Block.

to_block property

to_block: Block

The faced Block.

BlockGrowEvent

BlockGrowEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when a block grows naturally in the world.

If a Block Grow event is cancelled, the block will not grow.

Attributes:

Name Type Description
new_state BlockState

The new state of the block after it has grown.

new_state property

new_state: BlockState

The new state of the block after it has grown.

BlockPistonEvent

BlockPistonEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when a piston block is triggered.

Attributes:

Name Type Description
direction BlockFace

The direction in which the piston will operate.

direction property

direction: BlockFace

The direction in which the piston will operate.

BlockPistonExtendEvent

BlockPistonExtendEvent(is_async: bool = False)

Bases: BlockPistonEvent

Called when a piston extends.

BlockPistonRetractEvent

BlockPistonRetractEvent(is_async: bool = False)

Bases: BlockPistonEvent

Called when a piston retracts.

BlockPlaceEvent

BlockPlaceEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when a block is placed by a player.

If a BlockPlaceEvent is cancelled, the block will not be placed.

Attributes:

Name Type Description
block_against Block

The block that the new block was placed against.

block_placed Block

The Block that was placed.

block_replaced_state BlockState

The BlockState of the block that was replaced.

player Player

The Player who placed the block involved in this event.

block_against property

block_against: Block

The block that the new block was placed against.

block_placed property

block_placed: Block

The Block that was placed.

block_replaced_state property

block_replaced_state: BlockState

The BlockState of the block that was replaced.

player property

player: Player

The Player who placed the block involved in this event.

BroadcastMessageEvent

BroadcastMessageEvent(is_async: bool = False)

Bases: ServerEvent, Cancellable

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

This event should be async if fired from an async thread.

Attributes:

Name Type Description
message str | Translatable

The message to broadcast.

recipients set[CommandSender]

The set of CommandSenders who will see this broadcast message.

message property writable

message: str | Translatable

The message to broadcast.

recipients property

recipients: set[CommandSender]

The set of CommandSenders who will see this broadcast message.

Cancellable

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

Methods:

Name Description
cancel

Cancel this event.

Attributes:

Name Type Description
is_cancelled bool

Gets or sets the cancellation state of this event.

is_cancelled property writable

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.

CauldronLevelChangeEvent

CauldronLevelChangeEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when a cauldron's level or contents change.

Classes:

Name Description
ChangeReason

The reason the cauldron changed.

Attributes:

Name Type Description
ARMOR_WASH
BANNER_WASH
BOTTLE_EMPTY
BOTTLE_FILL
BUCKET_EMPTY
BUCKET_FILL
EVAPORATE
EXTINGUISH
NATURAL_FILL
SHULKER_WASH
UNKNOWN
actor Actor | None

The actor which did this, or None.

new_state BlockState

The state the cauldron will take.

reason ChangeReason

The reason for the change.

ARMOR_WASH class-attribute instance-attribute

ARMOR_WASH = ChangeReason.ARMOR_WASH

BANNER_WASH class-attribute instance-attribute

BANNER_WASH = ChangeReason.BANNER_WASH

BOTTLE_EMPTY class-attribute instance-attribute

BOTTLE_EMPTY = ChangeReason.BOTTLE_EMPTY

BOTTLE_FILL class-attribute instance-attribute

BOTTLE_FILL = ChangeReason.BOTTLE_FILL

BUCKET_EMPTY class-attribute instance-attribute

BUCKET_EMPTY = ChangeReason.BUCKET_EMPTY

BUCKET_FILL class-attribute instance-attribute

BUCKET_FILL = ChangeReason.BUCKET_FILL

EVAPORATE class-attribute instance-attribute

EVAPORATE = ChangeReason.EVAPORATE

EXTINGUISH class-attribute instance-attribute

EXTINGUISH = ChangeReason.EXTINGUISH

NATURAL_FILL class-attribute instance-attribute

NATURAL_FILL = ChangeReason.NATURAL_FILL

SHULKER_WASH class-attribute instance-attribute

SHULKER_WASH = ChangeReason.SHULKER_WASH

UNKNOWN class-attribute instance-attribute

actor property

actor: Actor | None

The actor which did this, or None.

Only a player interacting with the cauldron is reported. Every other change reports None.

new_state property

new_state: BlockState

The state the cauldron will take.

Modifying the returned state changes what the cauldron becomes.

reason property

reason: ChangeReason

The reason for the change.

Only a player interacting with the cauldron is attributed. Every other change reports ChangeReason.UNKNOWN.

ChangeReason

Bases: Enum

The reason the cauldron changed.

Attributes:

Name Type Description
ARMOR_WASH
BANNER_WASH
BOTTLE_EMPTY
BOTTLE_FILL
BUCKET_EMPTY
BUCKET_FILL
EVAPORATE
EXTINGUISH
NATURAL_FILL
SHULKER_WASH
UNKNOWN
ARMOR_WASH class-attribute instance-attribute
ARMOR_WASH = 5
BANNER_WASH class-attribute instance-attribute
BANNER_WASH = 4
BOTTLE_EMPTY class-attribute instance-attribute
BOTTLE_EMPTY = 3
BOTTLE_FILL class-attribute instance-attribute
BOTTLE_FILL = 2
BUCKET_EMPTY class-attribute instance-attribute
BUCKET_EMPTY = 1
BUCKET_FILL class-attribute instance-attribute
BUCKET_FILL = 0
EVAPORATE class-attribute instance-attribute
EVAPORATE = 8
EXTINGUISH class-attribute instance-attribute
EXTINGUISH = 7
NATURAL_FILL class-attribute instance-attribute
NATURAL_FILL = 9
SHULKER_WASH class-attribute instance-attribute
SHULKER_WASH = 6
UNKNOWN class-attribute instance-attribute
UNKNOWN = 10

ChunkEvent

ChunkEvent(is_async: bool = False)

Bases: DimensionEvent

Represents a Chunk related event.

Attributes:

Name Type Description
chunk Chunk

The Chunk being loaded/unloaded.

chunk property

chunk: Chunk

The Chunk being loaded/unloaded.

ChunkLoadEvent

ChunkLoadEvent(is_async: bool = False)

Bases: ChunkEvent

Called when a chunk is loaded.

ChunkUnloadEvent

ChunkUnloadEvent(is_async: bool = False)

Bases: ChunkEvent

Called when a chunk is unloaded.

DimensionEvent

DimensionEvent(is_async: bool = False)

Bases: LevelEvent

Represents events within a dimension.

Attributes:

Name Type Description
dimension Dimension

The Dimension primarily involved with this event.

dimension property

dimension: Dimension

The Dimension primarily involved with this event.

DimensionLoadEvent

DimensionLoadEvent(is_async: bool = False)

Bases: DimensionEvent

Called when a dimension is loaded.

EnchantItemEvent

EnchantItemEvent(is_async: bool = False)

Bases: InventoryEvent, Cancellable

Called when a player enchants an item at an enchanting table.

Cancelling the event leaves the item, the player's experience levels and the lapis lazuli untouched.

Bedrock does not reveal a single hinted enchantment for an offer, so every enchantment the offer applies is listed in enchants_to_add.

Attributes:

Name Type Description
enchant_block Block

The enchanting table involved in this event.

enchanter Player

The player enchanting the item.

enchants_to_add dict[Enchantment, int]

A copy of the enchantments and levels that will be applied; assign it back after changes.

exp_level_cost int

The minimum player level required by the selected option.

item ItemStack

The item that will be enchanted.

which_button int

The selected enchanting button, from 0 to 2.

enchant_block property

enchant_block: Block

The enchanting table involved in this event.

enchanter property

enchanter: Player

The player enchanting the item.

enchants_to_add property writable

enchants_to_add: dict[Enchantment, int]

A copy of the enchantments and levels that will be applied; assign it back after changes.

exp_level_cost property writable

exp_level_cost: int

The minimum player level required by the selected option.

item property writable

item: ItemStack

The item that will be enchanted.

which_button property

which_button: int

The selected enchanting button, from 0 to 2.

Event

Event(is_async: bool = False)

Represents an event.

Attributes:

Name Type Description
event_name str

A user-friendly identifier for this event.

is_asynchronous bool

False by default, True if the event fires asynchronously.

event_name property

event_name: str

A user-friendly identifier for this event.

is_asynchronous property

is_asynchronous: bool

False by default, True if the event fires asynchronously.

EventPriority

Bases: IntEnum

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

Attributes:

Name Type Description
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

HIGH class-attribute instance-attribute

HIGH = 3

Event call is of high importance

HIGHEST class-attribute instance-attribute

HIGHEST = 4

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

LOW class-attribute instance-attribute

LOW = 1

Event call is of low importance

LOWEST class-attribute instance-attribute

LOWEST = 0

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

MONITOR class-attribute instance-attribute

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.

NORMAL class-attribute instance-attribute

NORMAL = 2

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

EventResult

Bases: Enum

Represents the result a plugin can apply to an event whose default behaviour can be allowed, denied, or left to the server.

Attributes:

Name Type Description
ALLOW
DEFAULT
DENY

ALLOW class-attribute instance-attribute

ALLOW = 2

DEFAULT class-attribute instance-attribute

DEFAULT = 1

DENY class-attribute instance-attribute

DENY = 0

InventoryCloseEvent

InventoryCloseEvent(is_async: bool = False)

Bases: InventoryEvent

Called when a player closes an inventory.

Attributes:

Name Type Description
player Player

The player who is closing the inventory.

player property

player: Player

The player who is closing the inventory.

InventoryEvent

InventoryEvent(is_async: bool = False)

Bases: Event

Represents a player related inventory event.

Attributes:

Name Type Description
inventory Inventory

The primary Inventory involved in this transaction.

inventory property

inventory: Inventory

The primary Inventory involved in this transaction.

InventoryInteractEvent

InventoryInteractEvent(is_async: bool = False)

Bases: InventoryEvent, Cancellable

An abstract base class for events that describe an interaction between a Player and the contents of an Inventory.

Attributes:

Name Type Description
who_clicked Player

The player who performed the click.

who_clicked property

who_clicked: Player

The player who performed the click.

InventoryOpenEvent

InventoryOpenEvent(is_async: bool = False)

Bases: InventoryEvent, Cancellable

Called when a player opens an inventory.

If this event is cancelled, the inventory will not be opened and the player will not see the container screen.

Attributes:

Name Type Description
player Player

The player who is opening the inventory.

player property

player: Player

The player who is opening the inventory.

LeavesDecayEvent

LeavesDecayEvent(is_async: bool = False)

Bases: BlockEvent, Cancellable

Called when leaves are decaying naturally.

If a Leaves Decay event is cancelled, the leaves will not decay.

LevelEvent

LevelEvent(is_async: bool = False)

Bases: Event

Represents events within a level.

Attributes:

Name Type Description
level Level

The Level primarily involved with this event.

level property

level: Level

The Level primarily involved with this event.

MapInitializeEvent

MapInitializeEvent(is_async: bool = False)

Bases: ServerEvent

Called when a map is initialized.

Attributes:

Name Type Description
map MapView

The Map initialized in this event.

map property

map: MapView

The Map initialized in this event.

MobEvent

MobEvent(is_async: bool = False)

Bases: Event

Represents an Mob-related event.

Attributes:

Name Type Description
actor Mob

The Mob which is involved in this event.

actor property

actor: Mob

The Mob which is involved in this event.

PacketReceiveEvent

PacketReceiveEvent(is_async: bool = False)

Bases: ServerEvent, Cancellable

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

Attributes:

Name Type Description
address SocketAddress

The network address of the client that sent this packet.

packet_id int

The ID of the packet.

payload bytes

The raw packet data, excluding the header.

player Player | None

The Player who is involved in this event.

sub_client_id int

The SubClient ID.

address property

address: SocketAddress

The network address of the client that sent this packet.

packet_id property

packet_id: int

The ID of the packet.

payload property writable

payload: bytes

The raw packet data, excluding the header.

player property

player: Player | None

The Player who is involved in this event.

This may return None if the packet is sent before the player completes the login process.

sub_client_id property

sub_client_id: int

The SubClient ID.

Range is 0 to 3 (0 = primary client; 1-3 = split-screen clients).

PacketSendEvent

PacketSendEvent(is_async: bool = False)

Bases: ServerEvent, Cancellable

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

Attributes:

Name Type Description
address SocketAddress

The network address to which this packet is being sent.

packet_id int

The ID of the packet.

payload bytes

The raw packet data, excluding the header.

player Player | None

The Player who is involved in this event.

sub_client_id int

The SubClient ID.

address property

address: SocketAddress

The network address to which this packet is being sent.

packet_id property

packet_id: int

The ID of the packet.

payload property writable

payload: bytes

The raw packet data, excluding the header.

player property

player: Player | None

The Player who is involved in this event.

This may return None if the packet is sent before the player completes the login process.

sub_client_id property

sub_client_id: int

The SubClient ID.

Range is 0 to 3 (0 = primary client; 1-3 = split-screen clients).

PlayerArmSwingEvent

PlayerArmSwingEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player swings their arm.

Cancelling stops the server acting on the swing at all. The swing is neither recorded nor shown to the other players in the dimension.

Note

The swinging player still sees their own arm move, because their client plays the animation without waiting for the server. The event covers swings the player starts. Swings the server drives itself, such as dropping an item, do not fire it.

Attributes:

Name Type Description
item ItemStack | None

The item the player was holding when they swung their arm.

item property

item: ItemStack | None

The item the player was holding when they swung their arm.

PlayerArmorStandManipulateEvent

PlayerArmorStandManipulateEvent(is_async: bool = False)

Bases: PlayerInteractActorEvent

Called when a player interacts with an armor stand and will either swap, retrieve or place an item.

Attributes:

Name Type Description
armor_stand_item ItemStack

The item held by the armor stand in the affected slot.

player_item ItemStack

The item held by the player during the interaction.

slot EquipmentSlot

The armor stand equipment slot affected by the interaction.

armor_stand_item property

armor_stand_item: ItemStack

The item held by the armor stand in the affected slot.

player_item property

player_item: ItemStack

The item held by the player during the interaction.

slot property

The armor stand equipment slot affected by the interaction.

PlayerBedEnterEvent

PlayerBedEnterEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

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

Attributes:

Name Type Description
bed Block

The bed block involved in this event.

bed property

bed: Block

The bed block involved in this event.

PlayerBedLeaveEvent

PlayerBedLeaveEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player is leaving a bed.

Attributes:

Name Type Description
bed Block

The bed block involved in this event.

bed property

bed: Block

The bed block involved in this event.

PlayerBucketActorEvent

PlayerBucketActorEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player captures an actor in a bucket.

Attributes:

Name Type Description
actor Actor

The actor being captured.

hand EquipmentSlot

The hand used to capture the actor.

original_bucket ItemStack

The bucket used to capture the actor.

actor property

actor: Actor

The actor being captured.

hand property

The hand used to capture the actor.

original_bucket property

original_bucket: ItemStack

The bucket used to capture the actor.

PlayerBucketEmptyEvent

PlayerBucketEmptyEvent(is_async: bool = False)

Bases: PlayerBucketEvent

Called when a player empties a bucket.

PlayerBucketEvent

PlayerBucketEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Base class for events involving a player's bucket interaction.

Attributes:

Name Type Description
block Block | None

The block involved in this event, or None if unavailable.

block_clicked Block

The block clicked by the player.

block_face BlockFace

The face on the clicked block.

bucket ItemType

The bucket used in this event.

hand EquipmentSlot

The hand used in this event.

item_stack ItemStack | None

The resulting item in the player's hand, or None if unavailable.

block property

block: Block | None

The block involved in this event, or None if unavailable.

block_clicked property

block_clicked: Block

The block clicked by the player.

block_face property

block_face: BlockFace

The face on the clicked block.

bucket property

bucket: ItemType

The bucket used in this event.

hand property

The hand used in this event.

This is always EquipmentSlot.HAND, because Bedrock does not report which hand was used for this interaction.

item_stack property writable

item_stack: ItemStack | None

The resulting item in the player's hand, or None if unavailable.

PlayerBucketFillEvent

PlayerBucketFillEvent(is_async: bool = False)

Bases: PlayerBucketEvent

Called when a player fills a bucket.

PlayerChatEvent

PlayerChatEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player sends a chat message.

Attributes:

Name Type Description
format str

The format to use to display this chat message.

message str

The message that the player is attempting to send.

player Player

The player that this message will be displayed as being sent by.

recipients list[Player]

The set of Players who will see this chat message.

format property writable

format: str

The format to use to display this chat message.

See the format string syntax at https://en.cppreference.com/w/cpp/utility/format/spec.html.

message property writable

message: str

The message that the player is attempting to send.

player property writable

player: Player

The player that this message will be displayed as being sent by.

recipients property

recipients: list[Player]

The set of Players who will see this chat message.

PlayerCommandEvent

PlayerCommandEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called whenever a player runs a command.

Attributes:

Name Type Description
command str

The command that the player is attempting to send.

command property writable

command: str

The command that the player is attempting to send.

PlayerCraftItemEvent

PlayerCraftItemEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player crafts an item, either inside a crafting grid or straight from the recipe book.

If the event is cancelled the item will not be crafted and the ingredients will not be consumed.

Attributes:

Name Type Description
ingredients list[ItemStack]

The ingredients a single craft consumes.

recipe Recipe

A copy of the current recipe on the crafting matrix.

repetitions int

The number of times the recipe is being crafted.

results list[ItemStack]

The items a single craft produces.

ingredients property

ingredients: list[ItemStack]

The ingredients a single craft consumes.

These are the items in the crafting grid where the player used one. Crafting from the recipe book never fills the grid, so the ingredients then come from the recipe instead, and an ingredient that accepts several items reports the one the recipe names rather than the one the player supplied.

recipe property

recipe: Recipe

A copy of the current recipe on the crafting matrix.

repetitions property writable

repetitions: int

The number of times the recipe is being crafted.

This is usually 1, but is higher when a batch is crafted at once, such as a shift click in the recipe book.

results property writable

results: list[ItemStack]

The items a single craft produces.

A recipe usually produces one item, but may produce several, and an ingredient that leaves a remainder behind contributes one too. Results are replaced one for one, so any beyond the number the recipe produces are ignored; cancel the event to stop the craft instead.

PlayerDeathEvent

PlayerDeathEvent(is_async: bool = False)

Bases: ActorDeathEvent

Called when a Player dies.

Attributes:

Name Type Description
death_message str | Translatable | None

The death message that will appear to everyone on the server.

player Player

The Player which is involved in this event.

death_message property writable

death_message: str | Translatable | None

The death message that will appear to everyone on the server.

player property

player: Player

The Player which is involved in this event.

PlayerDimensionChangeEvent

PlayerDimensionChangeEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player switches to another dimension.

Attributes:

Name Type Description
from_dimension Dimension

The player's previous dimension.

to_dimension Dimension

The player's new dimension.

from_dimension property

from_dimension: Dimension

The player's previous dimension.

to_dimension property

to_dimension: Dimension

The player's new dimension.

PlayerDropItemEvent

PlayerDropItemEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player drops an item from their inventory.

Attributes:

Name Type Description
item ItemStack

The ItemStack dropped by the player.

item property

item: ItemStack

The ItemStack dropped by the player.

PlayerEditBookEvent

PlayerEditBookEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player edits or signs a book.

Attributes:

Name Type Description
is_signing bool

Whether the player is signing the book.

new_book_meta BookMeta

The book metadata that the player is attempting to add to the book.

previous_book_meta BookMeta

A copy of the book metadata before the edit.

slot int

The inventory slot containing the book.

is_signing property writable

is_signing: bool

Whether the player is signing the book.

new_book_meta property writable

new_book_meta: BookMeta

The book metadata that the player is attempting to add to the book.

Note

Reading this gives a copy: assign to it to change what will actually be added to the book.

A title, an author and a generation are only written when the book is being signed. On a plain edit the book stays a book and quill, which holds none of them, and they are dropped. See is_signing.

previous_book_meta property

previous_book_meta: BookMeta

A copy of the book metadata before the edit.

Note

This is a copy: changes made to it are not written back to the book.

slot property

slot: int

The inventory slot containing the book.

PlayerEmoteEvent

PlayerEmoteEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player uses an emote.

Attributes:

Name Type Description
emote_id str

The emote piece ID.

is_muted bool

The muted state for the emote.

emote_id property

emote_id: str

The emote piece ID.

is_muted property writable

is_muted: bool

The muted state for the emote.

When True, the emote is executed without sending a chat message about the emote.

PlayerEvent

PlayerEvent(is_async: bool = False)

Bases: Event

Represents a player related event.

Attributes:

Name Type Description
player Player

The Player who is involved in this event.

player property

player: Player

The Player who is involved in this event.

PlayerExpChangeEvent

PlayerExpChangeEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player's experience changes.

Attributes:

Name Type Description
amount int

The amount of experience the player will be given.

amount property writable

amount: int

The amount of experience the player will be given.

PlayerGameModeChangeEvent

PlayerGameModeChangeEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when the GameMode of the player is changed.

Attributes:

Name Type Description
new_game_mode GameMode

The GameMode the player is switched to.

new_game_mode property

new_game_mode: GameMode

The GameMode the player is switched to.

PlayerHideActorEvent

PlayerHideActorEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a visible actor is hidden from a player.

This event is only called when the actor's visibility status is actually changed. It is called regardless of whether the actor is within the player's tracking range.

Attributes:

Name Type Description
actor Actor

The actor hidden from the player.

actor property

actor: Actor

The actor hidden from the player.

PlayerInputEvent

PlayerInputEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player sends updated input to the server.

Attributes:

Name Type Description
input Input

The new input received from this player.

input property

input: Input

The new input received from this player.

PlayerInteractActorEvent

PlayerInteractActorEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player right-clicks an actor.

Attributes:

Name Type Description
actor Actor

The actor that was right-clicked by the player.

actor property

actor: Actor

The actor that was right-clicked by the player.

PlayerInteractEvent

PlayerInteractEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player interacts with an object or air.

Classes:

Name Description
Action

Represents the type of interaction that triggered this event.

Attributes:

Name Type Description
LEFT_CLICK_AIR
LEFT_CLICK_BLOCK
RIGHT_CLICK_AIR
RIGHT_CLICK_BLOCK
action Action

The action type of this interaction.

block Block | None

The block clicked with this item.

block_face BlockFace

The face of the block that was clicked.

clicked_position Vector | None

The exact position on the block the player interacted with.

has_block bool

True if this event involved a block.

has_item bool

True if this event involved an item.

item ItemStack | None

The item in hand represented by this event, or None if no item.

LEFT_CLICK_AIR class-attribute instance-attribute

LEFT_CLICK_AIR = Action.LEFT_CLICK_AIR

LEFT_CLICK_BLOCK class-attribute instance-attribute

LEFT_CLICK_BLOCK = Action.LEFT_CLICK_BLOCK

RIGHT_CLICK_AIR class-attribute instance-attribute

RIGHT_CLICK_AIR = Action.RIGHT_CLICK_AIR

RIGHT_CLICK_BLOCK class-attribute instance-attribute

RIGHT_CLICK_BLOCK = Action.RIGHT_CLICK_BLOCK

action property

action: Action

The action type of this interaction.

block property

block: Block | None

The block clicked with this item.

block_face property

block_face: BlockFace

The face of the block that was clicked.

clicked_position property

clicked_position: Vector | None

The exact position on the block the player interacted with.

This will be None outside of Action.RIGHT_CLICK_BLOCK. All vector components are between 0.0 and 1.0 inclusive.

has_block property

has_block: bool

True if this event involved a block.

has_item property

has_item: bool

True if this event involved an item.

item property

item: ItemStack | None

The item in hand represented by this event, or None if no item.

Action

Bases: Enum

Represents the type of interaction that triggered this event.

Attributes:

Name Type Description
LEFT_CLICK_AIR
LEFT_CLICK_BLOCK
RIGHT_CLICK_AIR
RIGHT_CLICK_BLOCK
LEFT_CLICK_AIR class-attribute instance-attribute
LEFT_CLICK_AIR = 2
LEFT_CLICK_BLOCK class-attribute instance-attribute
LEFT_CLICK_BLOCK = 0
RIGHT_CLICK_AIR class-attribute instance-attribute
RIGHT_CLICK_AIR = 3
RIGHT_CLICK_BLOCK class-attribute instance-attribute
RIGHT_CLICK_BLOCK = 1

PlayerItemConsumeEvent

PlayerItemConsumeEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

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

If the ItemStack is modified the server will use the effects of the new item and not remove the original one from the player's inventory.

If the event is cancelled the effect will not be applied and the item will not be removed from the player's inventory.

Attributes:

Name Type Description
hand EquipmentSlot

The hand used to consume the item.

item ItemStack

An ItemStack for the item being consumed.

hand property

The hand used to consume the item.

item property

item: ItemStack

An ItemStack for the item being consumed.

PlayerItemHeldEvent

PlayerItemHeldEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player changes their currently held item.

Attributes:

Name Type Description
new_slot int

The new held slot index.

previous_slot int

The previous held slot index.

new_slot property

new_slot: int

The new held slot index.

previous_slot property

previous_slot: int

The previous held slot index.

PlayerJoinEvent

PlayerJoinEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player joins a server.

Attributes:

Name Type Description
join_message str | Translatable | None

The join message to send to all online players.

join_message property writable

join_message: str | Translatable | None

The join message to send to all online players.

PlayerJumpEvent

PlayerJumpEvent(is_async: bool = False)

Bases: PlayerMoveEvent

Called when a player jumps.

PlayerKickEvent

PlayerKickEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player gets kicked from the server.

Attributes:

Name Type Description
reason str

The reason why the player is getting kicked.

reason property writable

reason: str

The reason why the player is getting kicked.

PlayerLevelChangeEvent

PlayerLevelChangeEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player's level changes.

Attributes:

Name Type Description
new_level int

The player's level after the change.

old_level int

The player's level before the change.

new_level property

new_level: int

The player's level after the change.

old_level property

old_level: int

The player's level before the change.

PlayerLoginEvent

PlayerLoginEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player attempts to login in.

Attributes:

Name Type Description
kick_message str

The kick message to display if the event is cancelled.

kick_message property writable

kick_message: str

The kick message to display if the event is cancelled.

PlayerMoveEvent

PlayerMoveEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player moves.

Attributes:

Name Type Description
from_location Location

The location that this player moved from.

to_location Location

The location that this player moved to.

from_location property writable

from_location: Location

The location that this player moved from.

to_location property writable

to_location: Location

The location that this player moved to.

PlayerOpenSignEvent

PlayerOpenSignEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player begins editing a sign's text.

Cancelling this event stops the sign editing menu from opening.

Classes:

Name Description
Cause

The cause of the sign opening.

Attributes:

Name Type Description
INTERACT
PLACE
PLUGIN
UNKNOWN
cause Cause

The cause of the sign opening.

side Side

The side of the sign being opened.

sign Sign

A captured state of the sign involved in this event.

INTERACT class-attribute instance-attribute

INTERACT = Cause.INTERACT

PLACE class-attribute instance-attribute

PLACE = Cause.PLACE

PLUGIN class-attribute instance-attribute

PLUGIN = Cause.PLUGIN

UNKNOWN class-attribute instance-attribute

UNKNOWN = Cause.UNKNOWN

cause property

cause: Cause

The cause of the sign opening.

side property

side: Side

The side of the sign being opened.

sign property

sign: Sign

A captured state of the sign involved in this event.

Cause

Bases: Enum

The cause of the sign opening.

Attributes:

Name Type Description
INTERACT
PLACE
PLUGIN
UNKNOWN
INTERACT class-attribute instance-attribute
INTERACT = 1
PLACE class-attribute instance-attribute
PLACE = 0
PLUGIN class-attribute instance-attribute
PLUGIN = 2
UNKNOWN class-attribute instance-attribute
UNKNOWN = 3

PlayerPickupArrowEvent

PlayerPickupArrowEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player picks up an arrow or a thrown trident from the ground.

Attributes:

Name Type Description
arrow Actor

The arrow picked up by the player.

arrow property

arrow: Actor

The arrow picked up by the player.

PlayerPickupExperienceEvent

PlayerPickupExperienceEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player picks up an experience orb.

Cancelling the event leaves the orb in the world.

Attributes:

Name Type Description
amount int

The amount of experience the orb is worth.

amount property

amount: int

The amount of experience the orb is worth.

PlayerPickupItemEvent

PlayerPickupItemEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

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

Attributes:

Name Type Description
item Item

The Item picked up by the entity.

item property

item: Item

The Item picked up by the entity.

PlayerPortalEvent

PlayerPortalEvent(is_async: bool = False)

Bases: PlayerTeleportEvent

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

PlayerQuitEvent

PlayerQuitEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player leaves a server.

Attributes:

Name Type Description
quit_message str | Translatable | None

The quit message to send to all online players.

quit_message property writable

quit_message: str | Translatable | None

The quit message to send to all online players.

PlayerRecipeBookSettingsChangeEvent

PlayerRecipeBookSettingsChangeEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player changes recipe book settings.

Classes:

Name Description
RecipeBookType

The recipe book type.

Attributes:

Name Type Description
BLAST_FURNACE
CRAFTING
FURNACE
SMOKER
is_filtering bool

Whether recipe filtering is enabled.

is_open bool

Whether the recipe book is open.

recipe_book_type RecipeBookType

The type of recipe book whose settings changed.

BLAST_FURNACE class-attribute instance-attribute

BLAST_FURNACE = RecipeBookType.BLAST_FURNACE

CRAFTING class-attribute instance-attribute

FURNACE class-attribute instance-attribute

SMOKER class-attribute instance-attribute

is_filtering property

is_filtering: bool

Whether recipe filtering is enabled.

is_open property

is_open: bool

Whether the recipe book is open.

recipe_book_type property

recipe_book_type: RecipeBookType

The type of recipe book whose settings changed.

RecipeBookType

Bases: Enum

The recipe book type.

Attributes:

Name Type Description
BLAST_FURNACE
CRAFTING
FURNACE
SMOKER
BLAST_FURNACE class-attribute instance-attribute
BLAST_FURNACE = 2
CRAFTING class-attribute instance-attribute
CRAFTING = 0
FURNACE class-attribute instance-attribute
FURNACE = 1
SMOKER class-attribute instance-attribute
SMOKER = 3

PlayerRespawnEvent

PlayerRespawnEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player respawns.

Classes:

Name Description
RespawnReason

An enum to specify the reason a respawn occurred.

Attributes:

Name Type Description
DEATH
END_PORTAL
respawn_reason RespawnReason

The reason this respawn occurred.

DEATH class-attribute instance-attribute

END_PORTAL class-attribute instance-attribute

respawn_reason property

respawn_reason: RespawnReason

The reason this respawn occurred.

RespawnReason

Bases: Enum

An enum to specify the reason a respawn occurred.

Attributes:

Name Type Description
DEATH
END_PORTAL
DEATH class-attribute instance-attribute
DEATH = 0
END_PORTAL class-attribute instance-attribute
END_PORTAL = 1

PlayerRiptideEvent

PlayerRiptideEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player activates the riptide enchantment, using their trident to propel them through the air.

The riptide action is currently performed client side, so manipulating the player in this event may have undesired effects.

Attributes:

Name Type Description
item ItemStack

An ItemStack for the trident being used.

item property

item: ItemStack

An ItemStack for the trident being used.

PlayerSetSpawnEvent

PlayerSetSpawnEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player's spawn is set, either by themselves or otherwise.

Assigning a new location redirects the spawn that is about to be written; cancelling leaves the respawn point untouched.

Note

Only the location's block coordinates and dimension are written back; Bedrock does not persist yaw/pitch for a respawn point. Cancelling stops the respawn point from changing, but not the feedback around it: /spawnpoint still reports success and a respawn anchor still plays its sound and message, because neither consults the setter. The event is not fired when Bedrock clears a respawn point, so /clearspawnpoint and breaking the bed a player is bound to are both silent.

Classes:

Name Description
Cause

The cause of the spawn change.

Attributes:

Name Type Description
BED
COMMAND
PLUGIN
RESPAWN_ANCHOR
UNKNOWN
cause Cause

The cause of the spawn change.

location Location | None

The spawn location, or None to remove the spawn location.

BED class-attribute instance-attribute

BED = Cause.BED

COMMAND class-attribute instance-attribute

COMMAND = Cause.COMMAND

PLUGIN class-attribute instance-attribute

PLUGIN = Cause.PLUGIN

RESPAWN_ANCHOR class-attribute instance-attribute

RESPAWN_ANCHOR = Cause.RESPAWN_ANCHOR

UNKNOWN class-attribute instance-attribute

UNKNOWN = Cause.UNKNOWN

cause property

cause: Cause

The cause of the spawn change.

location property writable

location: Location | None

The spawn location, or None to remove the spawn location.

Cause

Bases: Enum

The cause of the spawn change.

Attributes:

Name Type Description
BED
COMMAND
PLUGIN
RESPAWN_ANCHOR
UNKNOWN
BED class-attribute instance-attribute
BED = 0
COMMAND class-attribute instance-attribute
COMMAND = 2
PLUGIN class-attribute instance-attribute
PLUGIN = 3
RESPAWN_ANCHOR class-attribute instance-attribute
RESPAWN_ANCHOR = 1
UNKNOWN class-attribute instance-attribute
UNKNOWN = 4

PlayerShearActorEvent

PlayerShearActorEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player shears an actor.

Attributes:

Name Type Description
actor Actor

The actor being sheared.

hand EquipmentSlot

The hand used to shear the actor.

item ItemStack

The shears used.

actor property

actor: Actor

The actor being sheared.

hand property

The hand used to shear the actor.

item property

item: ItemStack

The shears used.

PlayerShowActorEvent

PlayerShowActorEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a hidden actor is shown to a player.

This event is only called when the actor's visibility status is actually changed. It is called regardless of whether the actor is within the player's tracking range.

Attributes:

Name Type Description
actor Actor

The actor shown to the player.

actor property

actor: Actor

The actor shown to the player.

PlayerSkinChangeEvent

PlayerSkinChangeEvent(is_async: bool = False)

Bases: PlayerEvent, Cancellable

Called when a player changes their skin.

Attributes:

Name Type Description
new_skin Skin

The skin that will be applied.

skin_change_message str | Translatable | None

The message to send to all online players for this skin change.

new_skin property

new_skin: Skin

The skin that will be applied.

skin_change_message property writable

skin_change_message: str | Translatable | None

The message to send to all online players for this skin change.

PlayerTeleportEvent

PlayerTeleportEvent(is_async: bool = False)

Bases: PlayerMoveEvent

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

PlayerToggleCrawlEvent

PlayerToggleCrawlEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player toggles their crawling state.

Attributes:

Name Type Description
is_crawling bool

Whether the player is now crawling or not.

is_crawling property

is_crawling: bool

Whether the player is now crawling or not.

PlayerToggleFlightEvent

PlayerToggleFlightEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player toggles their flying state.

Attributes:

Name Type Description
is_flying bool

Whether the player is now flying or not.

is_flying property

is_flying: bool

Whether the player is now flying or not.

PlayerToggleSneakEvent

PlayerToggleSneakEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player toggles their sneaking state.

Attributes:

Name Type Description
is_sneaking bool

Whether the player is now sneaking or not.

is_sneaking property

is_sneaking: bool

Whether the player is now sneaking or not.

PlayerToggleSprintEvent

PlayerToggleSprintEvent(is_async: bool = False)

Bases: PlayerEvent

Called when a player toggles their sprinting state.

Attributes:

Name Type Description
is_sprinting bool

Whether the player is now sprinting or not.

is_sprinting property

is_sprinting: bool

Whether the player is now sprinting or not.

PluginDisableEvent

PluginDisableEvent(is_async: bool = False)

Bases: ServerEvent

Called when a plugin is disabled.

Attributes:

Name Type Description
plugin Plugin

The Plugin involved in this event.

plugin property

plugin: Plugin

The Plugin involved in this event.

PluginEnableEvent

PluginEnableEvent(is_async: bool = False)

Bases: ServerEvent

Called when a plugin is enabled.

Attributes:

Name Type Description
plugin Plugin

The Plugin involved in this event.

plugin property

plugin: Plugin

The Plugin involved in this event.

ScriptMessageEvent

ScriptMessageEvent(is_async: bool = False)

Bases: ServerEvent, Cancellable

Called when a message is sent by the /scriptevent command.

Attributes:

Name Type Description
message str

The message to send.

message_id str

The message id to send.

sender CommandSender

The command sender who sent the script message.

message property

message: str

The message to send.

message_id property

message_id: str

The message id to send.

sender property

sender: CommandSender

The command sender who sent the script message.

ServerCommandEvent

ServerCommandEvent(is_async: bool = False)

Bases: ServerEvent, Cancellable

Called when a command is run by a non-player, early in the command handling process.

You should not use this except for a few cases like logging commands, blocking commands on certain places, or applying modifiers.

The command message contains a slash '/' at the start.

Attributes:

Name Type Description
command str

The command that the server is attempting to execute from the console.

sender CommandSender

The command sender.

command property writable

command: str

The command that the server is attempting to execute from the console.

sender property

sender: CommandSender

The command sender.

ServerEvent

ServerEvent(is_async: bool = False)

Bases: Event

Represents a Server-related event.

ServerListPingEvent

ServerListPingEvent(is_async: bool = False)

Bases: ServerEvent, Cancellable

Called when a server ping is coming in.

Attributes:

Name Type Description
address SocketAddress

The address the ping is coming from.

game_mode GameMode

The current game mode.

level_name str

The level name.

local_port int

The local port of the server.

max_players int

The maximum number of players allowed.

minecraft_version_network str

The network version of Minecraft that is supported by this server.

motd str

The message of the day.

network_protocol_version int

The network protocol version of this server.

num_players int

The number of players online.

server_guid str

The unique identifier of the server.

address property

address: SocketAddress

The address the ping is coming from.

game_mode property writable

game_mode: GameMode

The current game mode.

level_name property writable

level_name: str

The level name.

local_port property writable

local_port: int

The local port of the server.

max_players property writable

max_players: int

The maximum number of players allowed.

minecraft_version_network property writable

minecraft_version_network: str

The network version of Minecraft that is supported by this server.

motd property writable

motd: str

The message of the day.

network_protocol_version property

network_protocol_version: int

The network protocol version of this server.

num_players property writable

num_players: int

The number of players online.

server_guid property writable

server_guid: str

The unique identifier of the server.

ServerLoadEvent

ServerLoadEvent(is_async: bool = False)

Bases: ServerEvent

Called when either the server startup or reload has completed.

Classes:

Name Description
LoadType

Represents the context in which the server was loaded.

Attributes:

Name Type Description
RELOAD
STARTUP
type LoadType

The load type of this event.

RELOAD class-attribute instance-attribute

RELOAD = LoadType.RELOAD

STARTUP class-attribute instance-attribute

STARTUP = LoadType.STARTUP

type property

type: LoadType

The load type of this event.

LoadType

Bases: Enum

Represents the context in which the server was loaded.

Attributes:

Name Type Description
RELOAD
STARTUP
RELOAD class-attribute instance-attribute
RELOAD = 1
STARTUP class-attribute instance-attribute
STARTUP = 0

ThunderChangeEvent

ThunderChangeEvent(is_async: bool = False)

Bases: WeatherEvent, Cancellable

Called when the thunder state in a world is changing.

Attributes:

Name Type Description
to_thunder_state bool

True if the weather is being set to thundering, False otherwise.

to_thunder_state property

to_thunder_state: bool

True if the weather is being set to thundering, False otherwise.

UnknownCommandEvent

UnknownCommandEvent(is_async: bool = False)

Bases: Event

Called when a command sender executes a command that is not defined.

Attributes:

Name Type Description
command_line str

The command that was sent.

message str | Translatable | None

The message that will be returned, or None if no message will be sent.

sender CommandSender

The command sender.

command_line property

command_line: str

The command that was sent.

message property writable

message: str | Translatable | None

The message that will be returned, or None if no message will be sent.

sender property

sender: CommandSender

The command sender.

WeatherChangeEvent

WeatherChangeEvent(is_async: bool = False)

Bases: WeatherEvent, Cancellable

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

Attributes:

Name Type Description
to_weather_state bool

True if the weather is being set to raining, False otherwise.

to_weather_state property

to_weather_state: bool

True if the weather is being set to raining, False otherwise.

WeatherEvent

WeatherEvent(is_async: bool = False)

Bases: Event

Represents a Weather-related event.

Attributes:

Name Type Description
level Level

The Level where this event is occurring.

level property

level: Level

The Level where this event is occurring.

event_handler

event_handler(func: _F) -> _F
event_handler(
    *,
    priority: EventPriority = ...,
    ignore_cancelled: bool = ...
) -> Callable[[_F], _F]