Skip to content

Event Catalog

An event <Name> { } handler can name any concrete Minestom event. The catalog on this page is generated at build time from the pinned engine snapshot (Minestom ebaa2bbf64) — every public class under net.minestom.server.event.** that implements Event, plus SwoftLang's own first-class events (fishing, dispensers, mobs, TPS). Name one by its short catalog name or by its simple class name, and the compiler wires a listener for you.

swoftlang
event PlayerStartSprinting {
    execute {
        send "${event.player.name} sprints" to event.player
    }
}

Naming an event

Every catalog entry answers to two spellings — the short name (the class name with the trailing Event dropped) and the simple class name itself:

swoftlang
// these two declarations listen to exactly the same class
event PlayerFinishItemUse {
    execute {
        send "reeled in after ${event.use_duration} ticks" to event.player
    }
}
swoftlang
event PlayerFinishItemUseEvent {
    execute {
        send "reeled in after ${event.use_duration} ticks" to event.player
    }
}

A misspelled name is caught at compile time, with the nearest catalog match suggested:

swoftlang
event EntityDamg {
    execute {
        send "hurt" to all
    }
}
txt
ev.sw:1:1: error: unknown event 'EntityDamg'; did you mean 'EntityDamage'?
event EntityDamg {
^

Curated typed events vs. the generated catalog

Two kinds of events live in the catalog, and they differ only in how richly their event.* properties are typed.

Curated typed events are the core surface — the ones you reach for constantly. Their properties carry precise SwoftLang types (a Player, a Location, an optional<Item>), and most expose short alias bindings so you can write player and message instead of event.player and event.message.

Generated catalog events — every other class in the tables below — expose their properties as Any. A property is discovered from the class's record components and getX()/isX() getters; it is writable when the class ships a matching setX(..) setter (marked with * in the tables). Any values flow into send, interpolation, and further property reads directly; coerce with the usual forms when you need a concrete type.

swoftlang
event EntityShoot {
    execute {
        // 'power' and 'spread' have setters in the catalog, so they are writable
        set event.power to 1.5
        set event.spread to 0.0
        send "line out: ${event.projectile} towards ${event.to}" to all
    }
}

The curated typed events

EventCancellableAliasesevent.* properties
PlayerChatyesplayer, messageplayer (Player), message (String, rw), cancelled (rw)
PlayerJoinplayer, nameplayer (Player), first_spawn (Boolean), world (World)
PlayerUseItemyesplayer, itemplayer (Player), item (Item), custom_id (optional<String>), cancelled (rw)
MobSpawnmobmob (Mob)
MobDeathmob, killermob (Mob), killer (optional<Player>)
MobDamageyesmob, damagemob (Mob), damage (Double, rw), cancelled (rw)
BlockBreakyesplayer, block, locationplayer (Player), block (String), location (Location), cancelled (rw)
BlockPlaceyesplayer, block, locationplayer (Player), block (String), location (Location), cancelled (rw)
ServerPingmotdmotd (String, rw), online (Integer, rw), max (Integer, rw)
TpsChangepast, currentpast (Double), current (Double)
PlayerCastRodyesplayerplayer (Player), cancelled (rw)
FishBiteplayer, hook_locationplayer (Player), hook_location (Location)
PlayerCatchFishyesplayer, caught_item, caught_mobplayer (Player), caught_item (optional<Item>, rw), caught_mob (optional<Mob>), cancelled (rw)
PlayerReelInplayerplayer (Player)
BlockDispenseyeslocation, block, item, directionlocation (Location), block (String), item (optional<Item>, rw), direction (Vec), cancelled (rw)

PlayerUseItem and the engine's PlayerUseItemEvent

The curated PlayerUseItem identifier wraps SwoftLang's custom-items use event — it is what carries event.custom_id and drives the on_click item sugar. The raw engine event still has a spelling of its own: name VanillaUseItem (the typed identifier below) to listen to Minestom's PlayerUseItemEvent directly, with typed item_stack / hand / item_use_time rows.

Typed engine events

Between the two extremes sits a third tier: typed engine events. These name plain Minestom events — EntityDamage, PlayerMove, PickupItem — but their event.* properties carry precise SwoftLang types and real setters, hand-authored rather than discovered from getters. So event.damage is a writable Double, event.attacker is an optional<Entity>, event.damage_type is a String — properties the raw catalog never exposes. They have no short aliases; reach everything through event.<prop>.

Naming one of these gets you the typed rows below, not the generated Any rows the tables further down would suggest for the same class. EntityDamage is the one to reach for: attack damage flows through it (the engine's EntityAttack is not cancellable), so it is where you read the victim, scale the hit, inspect the source, and veto lethal damage.

swoftlang
event EntityDamage {
    execute {
        set event.damage to event.damage * 2.0
        send "${event.entity} took ${event.damage} (${event.damage_type})" to all
        if event.attacker exists {
            send "attacker: ${event.attacker}" to all
        }
        if event.damage > 100.0 {
            cancel event
        }
    }
}

Tier 1 — the events most scripts reach for

EventCancellableevent.* properties
EntityDamageyesentity (Entity), damage (Double, rw), attacker (optional<Entity>), source_entity (optional<Entity>), damage_type (String), cancelled (rw)
PlayerDeathplayer (Player), world (World), death_text (String, rw), chat_message (String, rw)
PlayerRespawnplayer (Player), world (World), respawn_position (Location, rw)
PlayerMoveyesplayer (Player), new_position (Location, rw), on_ground (Boolean), cancelled (rw)
PlayerBlockInteractyesplayer (Player), block (String), location (Location), block_face (String), hand (String), cursor_position (Location), cancelled (rw)
InventoryPreClickyesplayer (Player), slot (Integer), clicked_item (Item), cancelled (rw)
InventoryCloseplayer (Player), from_client (Boolean)
ItemDropyesplayer (Player), item_stack (Item), cancelled (rw)
PickupItemyesentity (Entity), item_stack (Item), item_entity (Entity), cancelled (rw)
PlayerGameModeChangeyesplayer (Player), new_game_mode (String, rw), cancelled (rw)
PlayerDisconnectplayer (Player), world (World)
PlayerUseItemOnBlockplayer (Player), item_stack (Item), location (Location), block_face (String), hand (String), cursor_position (Location)

Tier 2 — common, fully typed

EventCancellableevent.* properties
EntityDeathentity (Entity), world (World)
EntitySpawnentity (Entity), world (World)
EntityAttackentity (Entity), target (Entity), world (World)
EntityTeleportentity (Entity), new_position (Location)
EntityShootyesentity (Entity), projectile (Entity), to (Location), power (Double, rw), spread (Double, rw), cancelled (rw)
EntityVelocityyesentity (Entity), velocity (Vec, rw), cancelled (rw)
ProjectileCollideWithEntityyestarget (Entity), world (World), cancelled (rw)
PlayerEntityInteractplayer (Player), target (Entity), hand (String), interact_position (Location)
PlayerChangeHeldSlotyesplayer (Player), new_slot (Integer, rw), old_slot (Integer), item_in_new_slot (Item), item_in_old_slot (Item), cancelled (rw)
PickupExperienceyesplayer (Player), experience_count (Integer, rw), cancelled (rw)
PlayerBeginItemUseyesplayer (Player), item_stack (Item), hand (String), item_use_duration (Integer, rw), animation (String), cancelled (rw)
PlayerSwapItemyesplayer (Player), main_hand_item (Item, rw), off_hand_item (Item, rw), cancelled (rw)
PlayerStartDiggingyesplayer (Player), block (String), location (Location), block_face (String), cancelled (rw)
InventoryClickplayer (Player), slot (Integer), click_type (String), clicked_item (Item), cursor_item (Item)
InventoryOpenyesplayer (Player), cancelled (rw)
PlayerLoadedplayer (Player), world (World)
PlayerStartSprinting · PlayerStopSprintingplayer (Player), world (World)
PlayerStartFlying · PlayerStopFlyingplayer (Player), world (World)
VanillaUseItemyesplayer (Player), item_stack (Item), hand (String), item_use_time (Integer, rw), cancelled (rw)

VanillaUseItem is the vanilla PlayerUseItemEvent under a typed identifier of its own — the short name PlayerUseItem is taken by the custom-items use event.

Writing a settable property does what you'd expect — clamp a fall, redirect a teleport, rewrite a death message:

swoftlang
event PlayerMove {
    execute {
        if event.on_ground {
            set event.new_position to event.player.location
        }
    }
}
swoftlang
event PlayerGameModeChange {
    execute {
        send "${event.player.name} -> ${event.new_game_mode}" to event.player
    }
}

Cancelling

cancel event is legal on exactly the events the engine marks cancellable (the Cancellable column below, and cancelled in a curated event's rows). It is a compile error anywhere else:

swoftlang
event FishBite {
    execute {
        cancel event
    }
}
txt
nc.sw:3:9: error: event 'FishBite' is not cancellable
        cancel event
        ^

Cancellable catalog events also carry a settable cancelled property, so set event.cancelled to true and cancel event are two spellings of the same effect.

Priority and async

Every handler takes an optional priority: (lower runs first) and an execute body. Handlers run on the tick thread by default; a whole handler can be marked execute async where the work must not block a tick, following the usual async coloring rules.

swoftlang
event PickupItem {
    priority: 1

    execute {
        if event.cancelled {
            send "too slow, the catch is gone" to all
        }
        send "caught ${event.item_stack}" to all
    }
}

The generated catalog

* marks a property with a setter (writable). Names are the short catalog names; the simple class name (append Event) always works too. Rows here are what the compiler discovers from a class's getters — an event that also appears in the typed engine events tables above resolves to those richer typed rows instead, so consult those first. Projectile-flight events — EntityShoot, ProjectileCollideWithBlock, ProjectileCollideWithEntity, ProjectileUncollide — live in the entity group.

Player · player (47)

EventClass spellingCancellableDiscovered properties
AdvancementTabAdvancementTabEventaction, entity, instance, player, tab_id
AsyncPlayerConfigurationAsyncPlayerConfigurationEvententity, feature_flags, first_config, hardcore*, player, spawning_instance*
AsyncPlayerPreLoginAsyncPlayerPreLoginEventconnection, game_profile*, player_uuid, username*
PlayerAnvilInputPlayerAnvilInputEvententity, input, instance, inventory, player
PlayerBlockBreakPlayerBlockBreakEventyesblock, block_face, block_position, cancelled*, entity, instance, player, result_block*
PlayerBlockInteractPlayerBlockInteractEventyesblock, block_face, block_position, blocking_item_use*, cancelled*, cursor_position, entity, hand, instance, player
PlayerBlockPlacePlayerBlockPlaceEventyesblock*, block_face, block_position, cancelled*, cursor_position, entity, hand, instance, player
PlayerCancelDiggingPlayerCancelDiggingEventblock, block_position, entity, instance, player
PlayerChangeHeldSlotPlayerChangeHeldSlotEventyescancelled*, entity, instance, item_in_new_slot, item_in_old_slot, new_slot*, old_slot, player, slot*
PlayerChatPlayerChatEventyescancelled*, entity, formatted_message*, instance, player, raw_message, recipients
PlayerChunkLoadPlayerChunkLoadEventchunk_x, chunk_z, entity, instance, player
PlayerChunkUnloadPlayerChunkUnloadEventchunk_x, chunk_z, entity, instance, player
PlayerCommandPlayerCommandEventyescancelled*, command*, entity, instance, player
PlayerDeathPlayerDeathEventchat_message*, death_text*, entity, instance, player
PlayerDisconnectPlayerDisconnectEvententity, instance, player
PlayerEntityInteractPlayerEntityInteractEvententity, hand, instance, interact_position, player, target
PlayerFinishDiggingPlayerFinishDiggingEventblock*, block_position, entity, instance, player
PlayerGameModeChangePlayerGameModeChangeEventyescancelled*, entity, instance, new_game_mode*, player
PlayerHandAnimationPlayerHandAnimationEventyescancelled*, entity, hand, instance, player
PlayerLoadedPlayerLoadedEvententity, instance, player
PlayerMovePlayerMoveEventyescancelled*, entity, instance, new_position*, on_ground, player
PlayerPacketPlayerPacketEventyescancelled*, entity, instance, packet, player
PlayerPacketOutPlayerPacketOutEventyescancelled*, entity, packet, player
PlayerPickBlockPlayerPickBlockEventblock, block_position, entity, include_data, instance, player
PlayerPickEntityPlayerPickEntityEvententity, include_data, instance, player, target
PlayerPluginMessagePlayerPluginMessageEvententity, identifier, instance, message, message_string, player
PlayerPreEatPlayerPreEatEventyescancelled*, eating_time*, entity, food_item, hand, instance, item_stack, player
PlayerResourcePackStatusPlayerResourcePackStatusEvententity, player, status
PlayerRespawnPlayerRespawnEvententity, player, respawn_position*
PlayerSettingsChangePlayerSettingsChangeEvententity, player
PlayerSkinInitPlayerSkinInitEvententity, player, skin*
PlayerSpawnPlayerSpawnEvententity, first_spawn, instance, player, spawn_instance
PlayerSpectatePlayerSpectateEvententity, player, target
PlayerStartDiggingPlayerStartDiggingEventyesblock, block_face, block_position, cancelled*, entity, instance, player
PlayerStartFlyingPlayerStartFlyingEvententity, instance, player
PlayerStartFlyingWithElytraPlayerStartFlyingWithElytraEvententity, instance, player
PlayerStartSneakingPlayerStartSneakingEvententity, instance, player
PlayerStartSprintingPlayerStartSprintingEvententity, instance, player
PlayerStopFlyingPlayerStopFlyingEvententity, instance, player
PlayerStopFlyingWithElytraPlayerStopFlyingWithElytraEvententity, instance, player
PlayerStopSneakingPlayerStopSneakingEvententity, instance, player
PlayerStopSprintingPlayerStopSprintingEvententity, instance, player
PlayerSwapItemPlayerSwapItemEventyescancelled*, entity, instance, main_hand_item*, off_hand_item*, player
PlayerTickPlayerTickEvententity, instance, player
PlayerTickEndPlayerTickEndEvententity, instance, player
PlayerUseItemPlayerUseItemEventyescancelled*, entity, hand, instance, item_stack, item_use_time*, player
PlayerUseItemOnBlockPlayerUseItemOnBlockEventblock_face, entity, hand, instance, item_stack, player, position

Entity & projectile · entity (17)

EventClass spellingCancellableDiscovered properties
EntityAttackEntityAttackEvententity, instance, target
EntityDamageEntityDamageEventyescancelled*, damage, entity, instance, sound*
EntityDeathEntityDeathEvententity, instance
EntityDespawnEntityDespawnEvententity, instance
EntityFireExtinguishEntityFireExtinguishEventyescancelled*, entity, instance, natural
EntityItemMergeEntityItemMergeEventyescancelled*, entity, instance, merged, result*
EntityPotionAddEntityPotionAddEvententity, instance, potion
EntityPotionRemoveEntityPotionRemoveEvententity, instance, potion
EntitySetFireEntitySetFireEventyescancelled*, entity, fire_ticks*, instance
EntityShootEntityShootEventyescancelled*, entity, instance, power*, projectile, spread*, to
EntitySpawnEntitySpawnEvententity, instance, spawn_instance
EntityTeleportEntityTeleportEvententity, new_position, relative_flags, teleport_position
EntityTickEntityTickEvententity, instance
EntityVelocityEntityVelocityEventyescancelled*, entity, instance, velocity*
ProjectileCollideWithBlockProjectileCollideWithBlockEventyesblock, instance
ProjectileCollideWithEntityProjectileCollideWithEntityEventyesinstance, target
ProjectileUncollideProjectileUncollideEvententity, instance

Item · item (7)

EventClass spellingCancellableDiscovered properties
EntityEquipEntityEquipEvententity, equipped_item*, instance, item_stack, slot
ItemDropItemDropEventyescancelled*, entity, instance, item_stack, player
PickupExperiencePickupExperienceEventyescancelled*, entity, experience_count*, experience_orb, instance, player
PickupItemPickupItemEventyescancelled*, entity, instance, item_entity, item_stack, living_entity
PlayerBeginItemUsePlayerBeginItemUseEventyesanimation, cancelled*, entity, hand, instance, item_stack, item_use_duration*, player
PlayerCancelItemUsePlayerCancelItemUseEvententity, hand, instance, item_stack, player, riptide_spin_attack*, use_duration
PlayerFinishItemUsePlayerFinishItemUseEvententity, hand, instance, item_stack, player, riptide_spin_attack*, use_duration

Inventory · inventory (5)

EventClass spellingCancellableDiscovered properties
InventoryClickInventoryClickEventclick_type, clicked_item, cursor_item, entity, instance, inventory, player, slot
InventoryCloseInventoryCloseEvententity, from_client, instance, inventory, new_inventory*, player
InventoryItemChangeInventoryItemChangeEventinventory, new_item, previous_item, slot
InventoryOpenInventoryOpenEventyescancelled*, entity, instance, inventory*, player
InventoryPreClickInventoryPreClickEventyescancelled*, click_type, clicked_item*, cursor_item*, entity, instance, inventory, player, slot

Instance · instance (7)

EventClass spellingCancellableDiscovered properties
AddEntityToInstanceAddEntityToInstanceEventyescancelled*, entity, instance
InstanceChunkLoadInstanceChunkLoadEventchunk, chunk_x, chunk_z, instance
InstanceChunkUnloadInstanceChunkUnloadEventchunk, chunk_x, chunk_z, instance
InstanceRegisterInstanceRegisterEventinstance
InstanceTickInstanceTickEventduration, instance
InstanceUnregisterInstanceUnregisterEventinstance
RemoveEntityFromInstanceRemoveEntityFromInstanceEvententity, instance

Server · server (3)

EventClass spellingCancellableDiscovered properties
ClientPingServerClientPingServerEventyescancelled*, connection, delay*, payload*
ServerListPingServerListPingEventyescancelled*, connection, ping_type, response_data*
ServerTickMonitorServerTickMonitorEventtick_monitor

Book · book (1)

EventClass spellingCancellableDiscovered properties
EditBookEditBookEvententity, instance, item_stack, pages, player, signed, title

Every listed event is live

Name any row above in an event { } declaration today — the runtime registers a generic listener for its class and hands your handler the discovered properties. The four fishing events, the mob and TPS events, and BlockDispense sit alongside the engine catalog as first-class curated events.