Event
endstone.event
¶
Classes relating to handling triggered code executions.
Classes:
| Name | Description |
|---|---|
ActorChangeBlockEvent |
Called when an |
ActorCollideWithActorEvent |
Called when two actors collide with each other. |
ActorDamageEvent |
Called when an |
ActorDeathEvent |
Called when an |
ActorDismountEvent |
Called when an |
ActorEffectEvent |
Called when an effect on a |
ActorEvent |
Represents an |
ActorExplodeEvent |
Called when an actor explodes. |
ActorKnockbackEvent |
Called when a living entity receives knockback. |
ActorPickupItemEvent |
Called when an |
ActorRemoveEvent |
Called when an |
ActorSpawnEvent |
Called when an |
ActorTeleportEvent |
Called when a non-player entity is teleported from one location to another. |
ActorToggleGlideEvent |
Called when an |
ActorToggleSwimEvent |
Called when an |
BlockBreakEvent |
Called when a block is broken by a player. |
BlockCookEvent |
Called when an |
BlockEvent |
Represents an |
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 |
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 |
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: |
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 |
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 |
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 |
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 |
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. |
PrepareItemEnchantEvent |
Called when an enchanting table prepares offers for an item. |
ScriptMessageEvent |
Called when a message is sent by the |
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
block |
Block
|
The block that will be changed. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
actors |
list[Actor]
|
The actors that are involved in this event. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ActorDamageEvent
¶
ActorDamageEvent(is_async: bool = False)
Bases: MobEvent, Cancellable
Called when an Actor is damaged.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
damage |
float
|
The raw amount of damage caused by the event. |
damage_source |
DamageSource
|
A |
is_cancelled |
bool
|
The cancellation state of this event. |
damage_source
property
¶
damage_source: DamageSource
A DamageSource detailing the source of the damage.
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ActorDeathEvent
¶
ActorDeathEvent(is_async: bool = False)
Bases: MobEvent
Called when an Actor dies.
Attributes:
| Name | Type | Description |
|---|---|---|
damage_source |
DamageSource
|
A |
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
vehicle |
Actor
|
The actor that is being dismounted. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
ADDED |
|
|
action |
Action
|
How the effect changed. |
effect |
Effect
|
The effect involved in this event. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
Action
¶
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ActorExplodeEvent
¶
ActorExplodeEvent(is_async: bool = False)
Bases: ActorEvent, Cancellable
Called when an actor explodes.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
block_list |
list[Block]
|
The list of blocks that would have been removed or were removed from the explosion event. |
is_cancelled |
bool
|
The cancellation state of this event. |
location |
Location
|
The location where the explosion happened. |
block_list
property
writable
¶
The list of blocks that would have been removed or were removed from the explosion event.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ActorKnockbackEvent
¶
ActorKnockbackEvent(is_async: bool = False)
Bases: MobEvent, Cancellable
Called when a living entity receives knockback.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
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 |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
amount |
int
|
The number of items that will be picked up from the stack. |
is_cancelled |
bool
|
The cancellation state of this event. |
item |
Item
|
The Item picked up by the actor. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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).
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
from_location |
Location
|
The location that this actor moved from. |
is_cancelled |
bool
|
The cancellation state of this event. |
to_location |
Location
|
The location that this actor moved to. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
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. |
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
player |
Player
|
The |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
BlockCookEvent
¶
BlockCookEvent(is_async: bool = False)
Bases: BlockEvent, Cancellable
Called when an ItemStack is successfully cooked in a block.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
recipe |
CookingRecipe | None
|
The cooking recipe this event is for, or |
result |
ItemStack
|
The resultant |
source |
ItemStack
|
The smelted (source) |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
recipe
property
¶
recipe: CookingRecipe | None
The cooking recipe this event is for, or None if the server could not resolve one.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
block_list |
list[Block]
|
The list of blocks that would have been removed or were removed from the explosion event. |
is_cancelled |
bool
|
The cancellation state of this event. |
block_list
property
writable
¶
The list of blocks that would have been removed or were removed from the explosion event.
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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).
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
to_block |
Block
|
The faced |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
new_state |
BlockState
|
The new state of the block after it has grown. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
BlockPistonEvent
¶
BlockPistonEvent(is_async: bool = False)
Bases: BlockEvent, Cancellable
Called when a piston block is triggered.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
direction |
BlockFace
|
The direction in which the piston will operate. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
BlockPistonExtendEvent
¶
BlockPistonExtendEvent(is_async: bool = False)
Bases: BlockPistonEvent
Called when a piston extends.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
BlockPistonRetractEvent
¶
BlockPistonRetractEvent(is_async: bool = False)
Bases: BlockPistonEvent
Called when a piston retracts.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
block_against |
Block
|
The block that the new block was placed against. |
block_placed |
Block
|
The |
block_replaced_state |
BlockState
|
The |
is_cancelled |
bool
|
The cancellation state of this event. |
player |
Player
|
The |
block_replaced_state
property
¶
block_replaced_state: BlockState
The BlockState of the block that was replaced.
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
message |
str | Translatable
|
The message to broadcast. |
recipients |
set[CommandSender]
|
The set of |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
recipients
property
¶
recipients: set[CommandSender]
The set of CommandSenders who will see this broadcast message.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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 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. |
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
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 |
is_cancelled |
bool
|
The cancellation state of this event. |
new_state |
BlockState
|
The state the cauldron will take. |
reason |
ChangeReason
|
The reason for the change. |
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.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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 |
|
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ChunkEvent
¶
ChunkEvent(is_async: bool = False)
Bases: DimensionEvent
Represents a Chunk related event.
Attributes:
| Name | Type | Description |
|---|---|---|
chunk |
Chunk
|
The |
DimensionEvent
¶
DimensionEvent(is_async: bool = False)
Bases: LevelEvent
Represents events within a dimension.
Attributes:
| Name | Type | Description |
|---|---|---|
dimension |
Dimension
|
The |
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
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. |
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack
|
The item that will be enchanted. |
which_button |
int
|
The selected enchanting button, from 0 to 2. |
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.
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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
|
|
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 |
HIGHEST
class-attribute
instance-attribute
¶
Event call is critical and must have the final say in what happens to the event
LOWEST
class-attribute
instance-attribute
¶
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
¶
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
¶
Event call is neither important nor unimportant, and may be run normally
EventResult
¶
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. |
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
who_clicked |
Player
|
The player who performed the click. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
player |
Player
|
The player who is opening the inventory. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
MapInitializeEvent
¶
MapInitializeEvent(is_async: bool = False)
Bases: ServerEvent
Called when a map is initialized.
Attributes:
| Name | Type | Description |
|---|---|---|
map |
MapView
|
The |
PacketReceiveEvent
¶
PacketReceiveEvent(is_async: bool = False)
Bases: ServerEvent, Cancellable
Called when the server receives a packet from a connected client.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
address |
SocketAddress
|
The network address of the client that sent this packet. |
is_cancelled |
bool
|
The cancellation state of this event. |
packet_id |
int
|
The ID of the packet. |
payload |
bytes
|
The raw packet data, excluding the header. |
player |
Player | None
|
The |
sub_client_id |
int
|
The SubClient ID. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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).
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PacketSendEvent
¶
PacketSendEvent(is_async: bool = False)
Bases: ServerEvent, Cancellable
Called when the server sends a packet to a connected client.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
address |
SocketAddress
|
The network address to which this packet is being sent. |
is_cancelled |
bool
|
The cancellation state of this event. |
packet_id |
int
|
The ID of the packet. |
payload |
bytes
|
The raw packet data, excluding the header. |
player |
Player | None
|
The |
sub_client_id |
int
|
The SubClient ID. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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).
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack | None
|
The item the player was holding when they swung their arm. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
armor_stand_item |
ItemStack
|
The item held by the armor stand in the affected slot. |
is_cancelled |
bool
|
The cancellation state of this event. |
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.
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerBedEnterEvent
¶
PlayerBedEnterEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player is almost about to enter the bed.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
bed |
Block
|
The bed block involved in this event. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
PlayerBucketActorEvent
¶
PlayerBucketActorEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player captures an actor in a bucket.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
actor |
Actor
|
The actor being captured. |
hand |
EquipmentSlot
|
The hand used to capture the actor. |
is_cancelled |
bool
|
The cancellation state of this event. |
original_bucket |
ItemStack
|
The bucket used to capture the actor. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerBucketEmptyEvent
¶
PlayerBucketEmptyEvent(is_async: bool = False)
Bases: PlayerBucketEvent
Called when a player empties a bucket.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerBucketEvent
¶
PlayerBucketEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Base class for events involving a player's bucket interaction.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
block |
Block | None
|
The block involved in this event, or |
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. |
is_cancelled |
bool
|
The cancellation state of this event. |
item_stack |
ItemStack | None
|
The resulting item in the player's hand, or |
hand
property
¶
hand: EquipmentSlot
The hand used in this event.
This is always EquipmentSlot.HAND, because Bedrock does not report which hand was used for this interaction.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
item_stack
property
writable
¶
item_stack: ItemStack | None
The resulting item in the player's hand, or None if unavailable.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerBucketFillEvent
¶
PlayerBucketFillEvent(is_async: bool = False)
Bases: PlayerBucketEvent
Called when a player fills a bucket.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerChatEvent
¶
PlayerChatEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player sends a chat message.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
format |
str
|
The format to use to display this chat message. |
is_cancelled |
bool
|
The cancellation state of this event. |
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 |
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.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
player
property
writable
¶
player: Player
The player that this message will be displayed as being sent by.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerCommandEvent
¶
PlayerCommandEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called whenever a player runs a command.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
command |
str
|
The command that the player is attempting to send. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
ingredients |
list[ItemStack]
|
The ingredients a single craft consumes. |
is_cancelled |
bool
|
The cancellation state of this event. |
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
¶
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.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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
¶
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.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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 |
death_message
property
writable
¶
death_message: str | Translatable | None
The death message that will appear to everyone on the server.
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. |
PlayerDropItemEvent
¶
PlayerDropItemEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player drops an item from their inventory.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack
|
The |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerEditBookEvent
¶
PlayerEditBookEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player edits or signs a book.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
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_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerEmoteEvent
¶
PlayerEmoteEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player uses an emote.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
emote_id |
str
|
The emote piece ID. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_muted |
bool
|
The muted state for the emote. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
PlayerGameModeChangeEvent
¶
PlayerGameModeChangeEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when the GameMode of the player is changed.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
new_game_mode |
GameMode
|
The |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
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. |
PlayerInteractActorEvent
¶
PlayerInteractActorEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player right-clicks an actor.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
actor |
Actor
|
The actor that was right-clicked by the player. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
Methods:
| Name | Description |
|---|---|
cancel |
Cancel 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
|
|
has_item |
bool
|
|
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack | None
|
The item in hand represented by this event, or |
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.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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 |
|
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
hand |
EquipmentSlot
|
The hand used to consume the item. |
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack
|
An |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerItemHeldEvent
¶
PlayerItemHeldEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player changes their currently held item.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
new_slot |
int
|
The new held slot index. |
previous_slot |
int
|
The previous held slot index. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerKickEvent
¶
PlayerKickEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player gets kicked from the server.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
reason |
str
|
The reason why the player is getting kicked. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
PlayerLoginEvent
¶
PlayerLoginEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player attempts to login in.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
kick_message |
str
|
The kick message to display if the event is cancelled. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
kick_message
property
writable
¶
kick_message: str
The kick message to display if the event is cancelled.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerMoveEvent
¶
PlayerMoveEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player moves.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
from_location |
Location
|
The location that this player moved from. |
is_cancelled |
bool
|
The cancellation state of this event. |
to_location |
Location
|
The location that this player moved to. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
INTERACT |
|
|
PLACE |
|
|
PLUGIN |
|
|
UNKNOWN |
|
|
cause |
Cause
|
The cause of the sign opening. |
is_cancelled |
bool
|
The cancellation state of this event. |
side |
Side
|
The side of the sign being opened. |
sign |
Sign
|
A captured state of the sign involved in this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
Cause
¶
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerPickupArrowEvent
¶
PlayerPickupArrowEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player picks up an arrow or a thrown trident from the ground.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
arrow |
Actor
|
The arrow picked up by the player. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
amount |
int
|
The amount of experience the orb is worth. |
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerPickupItemEvent
¶
PlayerPickupItemEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player picks an item up from the ground.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
item |
Item
|
The Item picked up by the entity. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerPortalEvent
¶
PlayerPortalEvent(is_async: bool = False)
Bases: PlayerTeleportEvent
Called when a player is about to teleport because it is in contact with a portal.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
recipe_book_type
property
¶
recipe_book_type: RecipeBookType
The type of recipe book whose settings changed.
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. |
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 |
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. |
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
BED |
|
|
COMMAND |
|
|
PLUGIN |
|
|
RESPAWN_ANCHOR |
|
|
UNKNOWN |
|
|
cause |
Cause
|
The cause of the spawn change. |
is_cancelled |
bool
|
The cancellation state of this event. |
location |
Location | None
|
The spawn location, or |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
location
property
writable
¶
location: Location | None
The spawn location, or None to remove the spawn location.
Cause
¶
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerShearActorEvent
¶
PlayerShearActorEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player shears an actor.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
actor |
Actor
|
The actor being sheared. |
hand |
EquipmentSlot
|
The hand used to shear the actor. |
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack
|
The shears used. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
PlayerSkinChangeEvent
¶
PlayerSkinChangeEvent(is_async: bool = False)
Bases: PlayerEvent, Cancellable
Called when a player changes their skin.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
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. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
skin_change_message
property
writable
¶
skin_change_message: str | Translatable | None
The message to send to all online players for this skin change.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
PlayerTeleportEvent
¶
PlayerTeleportEvent(is_async: bool = False)
Bases: PlayerMoveEvent
Called when a player is teleported from one location to another.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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. |
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. |
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. |
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. |
PluginDisableEvent
¶
PluginDisableEvent(is_async: bool = False)
Bases: ServerEvent
Called when a plugin is disabled.
Attributes:
| Name | Type | Description |
|---|---|---|
plugin |
Plugin
|
The |
PluginEnableEvent
¶
PluginEnableEvent(is_async: bool = False)
Bases: ServerEvent
Called when a plugin is enabled.
Attributes:
| Name | Type | Description |
|---|---|---|
plugin |
Plugin
|
The |
PrepareItemEnchantEvent
¶
PrepareItemEnchantEvent(is_async: bool = False)
Bases: InventoryEvent, Cancellable
Called when an enchanting table prepares offers for an item.
Set an offer to None to hide it, or assign a new EnchantmentOffer to replace it. Each offer contains every
enchantment that Bedrock applies when its corresponding button is selected.
This event can be called multiple times while the enchanting table is open. Cancelling it removes all enchanting offers.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
enchant_block |
Block
|
The enchanting table involved in this event. |
enchanter |
Player
|
The player for whom the offers are being prepared. |
enchantment_bonus |
int
|
The enchanting bonus provided by nearby bookshelves. |
is_cancelled |
bool
|
The cancellation state of this event. |
item |
ItemStack
|
The item for which offers are being prepared. |
offers |
Annotated[list[EnchantmentOffer | None], FixedSize(3)]
|
A copy of the three enchanting offers; assign it back after changes. |
enchantment_bonus
property
¶
enchantment_bonus: int
The enchanting bonus provided by nearby bookshelves.
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
offers
property
writable
¶
offers: Annotated[
list[EnchantmentOffer | None], FixedSize(3)
]
A copy of the three enchanting offers; assign it back after changes.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ScriptMessageEvent
¶
ScriptMessageEvent(is_async: bool = False)
Bases: ServerEvent, Cancellable
Called when a message is sent by the /scriptevent command.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
message |
str
|
The message to send. |
message_id |
str
|
The message id to send. |
sender |
CommandSender
|
The command sender who sent the script message. |
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
command |
str
|
The command that the server is attempting to execute from the console. |
is_cancelled |
bool
|
The cancellation state of this event. |
sender |
CommandSender
|
The command sender. |
command
property
writable
¶
command: str
The command that the server is attempting to execute from the console.
is_cancelled
property
writable
¶
is_cancelled: bool
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 this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ServerListPingEvent
¶
ServerListPingEvent(is_async: bool = False)
Bases: ServerEvent, Cancellable
Called when a server ping is coming in.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
address |
SocketAddress
|
The address the ping is coming from. |
game_mode |
GameMode
|
The current game mode. |
is_cancelled |
bool
|
The cancellation state of this event. |
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. |
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
minecraft_version_network
property
writable
¶
minecraft_version_network: str
The network version of Minecraft that is supported by this server.
network_protocol_version
property
¶
network_protocol_version: int
The network protocol version of this server.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
ServerLoadEvent
¶
ServerLoadEvent(is_async: bool = False)
ThunderChangeEvent
¶
ThunderChangeEvent(is_async: bool = False)
Bases: WeatherEvent, Cancellable
Called when the thunder state in a world is changing.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
to_thunder_state |
bool
|
|
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
to_thunder_state
property
¶
to_thunder_state: bool
True if the weather is being set to thundering, False otherwise.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
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 |
sender |
CommandSender
|
The command sender. |
message
property
writable
¶
message: str | Translatable | None
The message that will be returned, or None if no message will be sent.
WeatherChangeEvent
¶
WeatherChangeEvent(is_async: bool = False)
Bases: WeatherEvent, Cancellable
Called when the weather (rain) state in a world is changing.
Methods:
| Name | Description |
|---|---|
cancel |
Cancel this event. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled |
bool
|
The cancellation state of this event. |
to_weather_state |
bool
|
|
is_cancelled
property
writable
¶
is_cancelled: bool
The cancellation state of this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
to_weather_state
property
¶
to_weather_state: bool
True if the weather is being set to raining, False otherwise.
cancel
¶
Cancel this event.
A cancelled event will not be executed in the server, but will still pass to other plugins.
event_handler
¶
event_handler(
*,
priority: EventPriority = ...,
ignore_cancelled: bool = ...
) -> Callable[[_F], _F]