Docs » API reference » Events

Events

Everything a plugin can react to. Some events come before something happens and can stop it; the rest say it has happened.

A plugin listens by giving a handler for an event, usually in enable. In Rust that is server.events().on_player_joined(|event| ...), in Java server.events().onPlayerJoined(event -> ...). Events arrive on the server's tick, and plugins hear each one in the order they loaded.

An event that can be stopped is sent before the thing happens, and its name says so (BlockBreaking). Calling stop() on it means the thing does not happen, and the player's game puts back whatever it had already shown. A listener can also change the fields marked changeable, such as the damage taken or the loot dropped. The event that follows (BlockBroken) says it did happen and cannot be stopped.

Listening

A handler can read every field of its event. Fields it may change are marked changeable below, and each handler sees the changes the one before it made. This one stops blocks being broken below Y 0:

server.events().on_block_breaking(|event| {
    if event.block.at.y < 0 {
        event.stop();
    }
})?;
server.events().onBlockBreaking(event -> {
    if (event.block().at().y() < 0) {
        event.stop();
    }
});

Players

EventWhenCan stop
PlayerJoiningA player has proved who they are and is about to enter the world.Yes
PlayerJoinedA player has entered the world and can be seen.
PlayerLeftA player has left: by choice, put out, or their connection ended.
PlayerDamagingA player is about to be hurt.Yes
PlayerFaintedA player's health reached nothing and they fainted.
PlayerRespawningA fainted player is getting up again.Yes
PlayerMovedBlockA player's feet moved into another block. Sent once a block, not every tick.
PlayerEnteredRegionA player walked into a Region a plugin made.
PlayerLeftRegionA player walked out of a Region.
PlayerEnteredTownA player came into a town (checked four times a second).
PlayerEnteredDungeonA player went down into a dungeon (when its banner shows).
PlayerAteA player ate or drank something.Yes
PlayerRestedA player sitting by a campfire was healed a step.

Blocks and objects

EventWhenCan stop
BlockBreakingA player is about to break a block.Yes
BlockBrokenA block was broken by a player.
BlockPlacingA player is about to place a block.Yes
BlockPlacedA player placed a block.
BlockChangedAny block changed that the world keeps, by anyone or anything: a player, water or lava flowing, sand falling, a plant growing, a plugin. Changes the world does not keep (a trap's spikes, falling snow, a boss room's lights) do not send it.
ObjectPlacingA player is about to place an object: furniture, a station, a chest, a bed, a door.Yes
ObjectRemovedA placed object was taken down whole and dropped as an item (a server object made from a content pack's model drops nothing): broken by a player, or fallen with what held it up. An object a plugin removes without a drop does not send it.
ContainerOpeningA player is opening a chest, barrel or other container.Yes
DoorUsedA player opened or shut a door or gate.Yes

Items and crafting

EventWhenCan stop
ItemPickingUpA player is taking up a loose item.Yes
ItemDroppedA player let go of or threw an item.
ItemCraftingA finished piece is about to be taken off its station, the moment the craft is the taker's: a workbench's output, an anvil's or fletching bench's piece, a forge's ingot (by hand or tongs), food cooked on a campfire's rim. A brew bottled from a cauldron or a meal ladled from a pot does not send it yet.Yes
ItemCraftedA finished piece was taken off its station (after ItemCrafting).
FishCaughtA player landed a catch with a rod. A fish sends this before it lands, so its item can be changed, and a hooked Voxelmon sends it once it has landed. A fish speared with a trident does not send it yet.
LootRolledLoot was chosen: a supply cache or a dungeon's cache broken, a chest filled as its town, dungeon or cave find is furnished, a wild Voxelmon's drops beaten in the world or in a battle (at most two stacks a beaten foe in a battle). Content packs' loot rules are added before plugins see it. A fishing catch sends FishCaught instead.

Voxelmon

EventWhenCan stop
CreatureSpawningA wild Voxelmon is about to appear, from the wild, a dungeon or a hive. It is sent on the tick the creature is made, before any player sees it. A den's pack, a hooked Voxelmon, a guardian and a plugin's own spawns do not send it yet. A content pack's spawn rule changes a wild one's species and level before plugins see it.Yes
CreatureSpawnedA wild Voxelmon appeared.
CreatureDamagingA wild Voxelmon is about to be hurt in the world: by a player's blow, arrow or trident, a burn, a falling spike. Harm in a turn-based battle and a companion's blows in an action world do not send it yet.Yes
CreatureBeatenA wild Voxelmon was beaten: in a turn-based battle, or in the world by a player's blow. One knocked out by a companion in an action world does not send it yet.
CaptureAttemptA cube thrown in the world is about to try to catch a Voxelmon. A cube used in a turn-based battle does not send it yet.Yes
CreatureCapturedA Voxelmon was caught.
CreatureLevelledUpA player's Voxelmon reached a new level.
CreatureEvolvingA player's Voxelmon is about to evolve.Yes
CreatureEvolvedA player's Voxelmon evolved.
CompanionSentOutA player threw a cube and their Voxelmon came out.
CompanionRecalledA player's companion went back into its cube.
CreaturePettedA player petted their companion.

Battles

EventWhenCan stop
BattleStartingA turn-based battle is about to begin, against a wild Voxelmon or a trainer.Yes
BattleStartedA battle began.
BattleTurnA battle's turn was decided.
BattleEndedA battle ended. It is sent when the result is decided (before the last turn's BattleTurn) or when the battle is called off.

Progress

EventWhenCan stop
ProfessionLevelledUpA player reached a new level in a profession.
CoinsChangedA player's coins changed.
TownFreedA town's Voxelord was beaten and the town freed.
DungeonBeatenA dungeon's guardian was beaten. players are those standing over the dungeon at that moment.
DungeonResetA beaten dungeon reset: at the first dawn a full day after its guardian fell, with no player inside, its chests refilled and its guardian will return; or through Dungeon.reset.

World

EventWhenCan stop
DayStartedDawn: a new day began.
NightStartedDusk: night began.
WeatherChangedThe weather changed in kind or strength (World.weather), because a spell of weather began or ended or a plugin set it.
WorldSavedThe world was saved.
EventWhenCan stop
MenuPressedA player pressed a button, tile or toggle on a plugin's Menu.
MenuClosedA player closed a plugin's menu, or walked away from it.

Each event

PlayerJoining

server.events().on_player_joining(|event: &mut PlayerJoining| ...)server.events().onPlayerJoining((PlayerJoining event) -> ...)

A player has proved who they are and is about to enter the world.

Can be stopped: the player is turned away with `reason`.

FieldDescription
event.profile: PlayerProfilePlayerProfile event.profile()Their store account's name and lasting ID, and whether they have played here before.
event.reason: StringString event.reason() / event.setReason(...) changeableWhat they are told if stopped.

PlayerJoined

server.events().on_player_joined(|event: & PlayerJoined| ...)server.events().onPlayerJoined((PlayerJoined event) -> ...)

A player has entered the world and can be seen.

FieldDescription
event.player: PlayerPlayer event.player()The player.
event.first_time: boolboolean event.firstTime()Their first time in this world.

PlayerLeft

server.events().on_player_left(|event: & PlayerLeft| ...)server.events().onPlayerLeft((PlayerLeft event) -> ...)

A player has left: by choice, put out, or their connection ended.

FieldDescription
event.player: PlayerPlayer event.player()The player, still readable during this event.
event.reason: LeaveReasonLeaveReason event.reason()Why they left.

PlayerDamaging

server.events().on_player_damaging(|event: &mut PlayerDamaging| ...)server.events().onPlayerDamaging((PlayerDamaging event) -> ...)

A player is about to be hurt.

Can be stopped: they take no harm.

FieldDescription
event.player: PlayerPlayer event.player()Who is hurt.
event.amount: f64double event.amount() / event.setAmount(...) changeableHealth lost.
event.cause: DamageCauseDamageCause event.cause()A creature, a fall, drowning, hunger, burning, a trap, a falling spike.
event.creature: Option<Creature>Optional<Creature> event.creature()The creature, if one did it (not yet: always empty; cause says a creature).

PlayerFainted

server.events().on_player_fainted(|event: &mut PlayerFainted| ...)server.events().onPlayerFainted((PlayerFainted event) -> ...)

A player's health reached nothing and they fainted.

FieldDescription
event.player: PlayerPlayer event.player()Who fainted.
event.cause: DamageCauseDamageCause event.cause()What did it.
event.keep_inventory: boolboolean event.keepInventory() / event.setKeepInventory(...) changeableWhether they keep what they carry.

PlayerRespawning

server.events().on_player_respawning(|event: &mut PlayerRespawning| ...)server.events().onPlayerRespawning((PlayerRespawning event) -> ...)

A fainted player is getting up again.

Can be stopped: they stay down (as in Hardcore).

FieldDescription
event.player: PlayerPlayer event.player()Who is getting up.
event.place: PlacePlace event.place() / event.setPlace(...) changeableWhere they will stand.

PlayerMovedBlock

server.events().on_player_moved_block(|event: & PlayerMovedBlock| ...)server.events().onPlayerMovedBlock((PlayerMovedBlock event) -> ...)

A player's feet moved into another block. Sent once a block, not every tick.

FieldDescription
event.player: PlayerPlayer event.player()Who moved.
event.from: BlockPosBlockPos event.from()The block they left.
event.to: BlockPosBlockPos event.to()The block they are in now.

PlayerEnteredRegion

server.events().on_player_entered_region(|event: & PlayerEnteredRegion| ...)server.events().onPlayerEnteredRegion((PlayerEnteredRegion event) -> ...)

A player walked into a Region a plugin made.

FieldDescription
event.player: PlayerPlayer event.player()Who entered.
event.region: RegionRegion event.region()The region.

PlayerLeftRegion

server.events().on_player_left_region(|event: & PlayerLeftRegion| ...)server.events().onPlayerLeftRegion((PlayerLeftRegion event) -> ...)

A player walked out of a Region.

FieldDescription
event.player: PlayerPlayer event.player()Who left.
event.region: RegionRegion event.region()The region.

PlayerEnteredTown

server.events().on_player_entered_town(|event: & PlayerEnteredTown| ...)server.events().onPlayerEnteredTown((PlayerEnteredTown event) -> ...)

A player came into a town (checked four times a second).

FieldDescription
event.player: PlayerPlayer event.player()Who entered.
event.town: TownTown event.town()The town.

PlayerEnteredDungeon

server.events().on_player_entered_dungeon(|event: & PlayerEnteredDungeon| ...)server.events().onPlayerEnteredDungeon((PlayerEnteredDungeon event) -> ...)

A player went down into a dungeon (when its banner shows).

FieldDescription
event.player: PlayerPlayer event.player()Who entered.
event.dungeon: DungeonDungeon event.dungeon()The dungeon.

PlayerAte

server.events().on_player_ate(|event: &mut PlayerAte| ...)server.events().onPlayerAte((PlayerAte event) -> ...)

A player ate or drank something.

Can be stopped: it is not eaten and stays in their hand.

FieldDescription
event.player: PlayerPlayer event.player()Who ate.
event.item: ItemStackItemStack event.item()What they ate.
event.hunger: f64double event.hunger() / event.setHunger(...) changeableHunger it restores (health, for a healing potion).

PlayerRested

server.events().on_player_rested(|event: &mut PlayerRested| ...)server.events().onPlayerRested((PlayerRested event) -> ...)

A player sitting by a campfire was healed a step.

FieldDescription
event.player: PlayerPlayer event.player()Who rested.
event.amount: f64double event.amount() / event.setAmount(...) changeableHealth restored.

BlockBreaking

server.events().on_block_breaking(|event: &mut BlockBreaking| ...)server.events().onBlockBreaking((BlockBreaking event) -> ...)

A player is about to break a block.

Can be stopped: the block stays.

FieldDescription
event.player: PlayerPlayer event.player()Who is breaking it.
event.block: BlockBlock event.block()The block and where it is.
event.tool: Option<ItemStack>Optional<ItemStack> event.tool()What they hold.
event.drops: Vec<ItemStack>List<ItemStack> event.drops() / event.setDrops(...) changeableWhat it will drop.

BlockBroken

server.events().on_block_broken(|event: & BlockBroken| ...)server.events().onBlockBroken((BlockBroken event) -> ...)

A block was broken by a player.

FieldDescription
event.player: PlayerPlayer event.player()Who broke it.
event.block: BlockBlock event.block()What it was.

BlockPlacing

server.events().on_block_placing(|event: &mut BlockPlacing| ...)server.events().onBlockPlacing((BlockPlacing event) -> ...)

A player is about to place a block.

Can be stopped: it is not placed and stays in their hand.

FieldDescription
event.player: PlayerPlayer event.player()Who is placing it.
event.block: BlockBlock event.block()The block and where it would go.

BlockPlaced

server.events().on_block_placed(|event: & BlockPlaced| ...)server.events().onBlockPlaced((BlockPlaced event) -> ...)

A player placed a block.

FieldDescription
event.player: PlayerPlayer event.player()Who placed it.
event.block: BlockBlock event.block()The block.

BlockChanged

server.events().on_block_changed(|event: & BlockChanged| ...)server.events().onBlockChanged((BlockChanged event) -> ...)

Any block changed that the world keeps, by anyone or anything: a player, water or lava flowing, sand falling, a plant growing, a plugin. Changes the world does not keep (a trap's spikes, falling snow, a boss room's lights) do not send it.

FieldDescription
event.at: BlockPosBlockPos event.at()Where.
event.before: BlockTypeBlockType event.before()What it was.
event.after: BlockTypeBlockType event.after()What it is now.

ObjectPlacing

server.events().on_object_placing(|event: &mut ObjectPlacing| ...)server.events().onObjectPlacing((ObjectPlacing event) -> ...)

A player is about to place an object: furniture, a station, a chest, a bed, a door.

Can be stopped: it is not placed.

FieldDescription
event.player: PlayerPlayer event.player()Who is placing it.
event.item: ItemTypeItemType event.item()The object.
event.at: BlockPosBlockPos event.at()Where.

ObjectRemoved

server.events().on_object_removed(|event: & ObjectRemoved| ...)server.events().onObjectRemoved((ObjectRemoved event) -> ...)

A placed object was taken down whole and dropped as an item (a server object made from a content pack's model drops nothing): broken by a player, or fallen with what held it up. An object a plugin removes without a drop does not send it.

FieldDescription
event.player: Option<Player>Optional<Player> event.player()Who took it down, if a player did.
event.object: PlacedObjectPlacedObject event.object()What it was (gone now: its handle reads nothing).

ContainerOpening

server.events().on_container_opening(|event: &mut ContainerOpening| ...)server.events().onContainerOpening((ContainerOpening event) -> ...)

A player is opening a chest, barrel or other container.

Can be stopped: it stays shut.

FieldDescription
event.player: PlayerPlayer event.player()Who is opening it.
event.container: PlacedObjectPlacedObject event.container()The container.

DoorUsed

server.events().on_door_used(|event: &mut DoorUsed| ...)server.events().onDoorUsed((DoorUsed event) -> ...)

A player opened or shut a door or gate.

Can be stopped: it stays as it was.

FieldDescription
event.player: PlayerPlayer event.player()Who used it.
event.door: PlacedObjectPlacedObject event.door()The door.
event.opening: boolboolean event.opening()True if opening.

ItemPickingUp

server.events().on_item_picking_up(|event: &mut ItemPickingUp| ...)server.events().onItemPickingUp((ItemPickingUp event) -> ...)

A player is taking up a loose item.

Can be stopped: it stays where it is.

FieldDescription
event.player: PlayerPlayer event.player()Who is taking it.
event.item: LooseItemLooseItem event.item()The item on the ground.

ItemDropped

server.events().on_item_dropped(|event: & ItemDropped| ...)server.events().onItemDropped((ItemDropped event) -> ...)

A player let go of or threw an item.

FieldDescription
event.player: PlayerPlayer event.player()Who dropped it.
event.item: LooseItemLooseItem event.item()The item, now loose.

ItemCrafting

server.events().on_item_crafting(|event: &mut ItemCrafting| ...)server.events().onItemCrafting((ItemCrafting event) -> ...)

A finished piece is about to be taken off its station, the moment the craft is the taker's: a workbench's output, an anvil's or fletching bench's piece, a forge's ingot (by hand or tongs), food cooked on a campfire's rim. A brew bottled from a cauldron or a meal ladled from a pot does not send it yet.

Can be stopped: the piece stays on its station.

FieldDescription
event.player: Option<Player>Optional<Player> event.player()Who is taking it.
event.station: StationStation event.station()Which kind of station.
event.result: ItemStackItemStack event.result() / event.setResult(...) changeableWhat the taker gets (the station gives up its own piece all the same).

ItemCrafted

server.events().on_item_crafted(|event: & ItemCrafted| ...)server.events().onItemCrafted((ItemCrafted event) -> ...)

A finished piece was taken off its station (after ItemCrafting).

FieldDescription
event.player: Option<Player>Optional<Player> event.player()Who took it.
event.station: StationStation event.station()Which kind of station.
event.result: ItemStackItemStack event.result()What it made.

FishCaught

server.events().on_fish_caught(|event: &mut FishCaught| ...)server.events().onFishCaught((FishCaught event) -> ...)

A player landed a catch with a rod. A fish sends this before it lands, so its item can be changed, and a hooked Voxelmon sends it once it has landed. A fish speared with a trident does not send it yet.

FieldDescription
event.player: PlayerPlayer event.player()Who caught it.
event.item: Option<ItemStack>Optional<ItemStack> event.item() / event.setItem(...) changeableThe item caught, if not a Voxelmon (one of it lands; none lands nothing).
event.creature: Option<Creature>Optional<Creature> event.creature()The Voxelmon hooked, if one was.

LootRolled

server.events().on_loot_rolled(|event: &mut LootRolled| ...)server.events().onLootRolled((LootRolled event) -> ...)

Loot was chosen: a supply cache or a dungeon's cache broken, a chest filled as its town, dungeon or cave find is furnished, a wild Voxelmon's drops beaten in the world or in a battle (at most two stacks a beaten foe in a battle). Content packs' loot rules are added before plugins see it. A fishing catch sends FishCaught instead.

FieldDescription
event.source: LootSourceLootSource event.source()What it is for.
event.player: Option<Player>Optional<Player> event.player()Who it is for, if anyone.
event.items: Vec<ItemStack>List<ItemStack> event.items() / event.setItems(...) changeableThe loot.

CreatureSpawning

server.events().on_creature_spawning(|event: &mut CreatureSpawning| ...)server.events().onCreatureSpawning((CreatureSpawning event) -> ...)

A wild Voxelmon is about to appear, from the wild, a dungeon or a hive. It is sent on the tick the creature is made, before any player sees it. A den's pack, a hooked Voxelmon, a guardian and a plugin's own spawns do not send it yet. A content pack's spawn rule changes a wild one's species and level before plugins see it.

Can be stopped: it does not appear.

FieldDescription
event.species: SpeciesSpecies event.species() / event.setSpecies(...) changeableIts species.
event.level: i64long event.level() / event.setLevel(...) changeableIts level.
event.place: PlacePlace event.place()Where.
event.reason: SpawnReasonSpawnReason event.reason()The wild, a dungeon or a hive.

CreatureSpawned

server.events().on_creature_spawned(|event: & CreatureSpawned| ...)server.events().onCreatureSpawned((CreatureSpawned event) -> ...)

A wild Voxelmon appeared.

FieldDescription
event.creature: CreatureCreature event.creature()The creature.

CreatureDamaging

server.events().on_creature_damaging(|event: &mut CreatureDamaging| ...)server.events().onCreatureDamaging((CreatureDamaging event) -> ...)

A wild Voxelmon is about to be hurt in the world: by a player's blow, arrow or trident, a burn, a falling spike. Harm in a turn-based battle and a companion's blows in an action world do not send it yet.

Can be stopped: it takes no harm.

FieldDescription
event.creature: CreatureCreature event.creature()Who is hurt.
event.amount: f64double event.amount() / event.setAmount(...) changeableHealth lost.
event.player: Option<Player>Optional<Player> event.player()The player whose blow, arrow or thrust did it.

CreatureBeaten

server.events().on_creature_beaten(|event: &mut CreatureBeaten| ...)server.events().onCreatureBeaten((CreatureBeaten event) -> ...)

A wild Voxelmon was beaten: in a turn-based battle, or in the world by a player's blow. One knocked out by a companion in an action world does not send it yet.

FieldDescription
event.creature: CreatureCreature event.creature()The creature: readable during this event in a battle; one beaten in the world has already left it.
event.player: Option<Player>Optional<Player> event.player()Who beat it.
event.experience: i64long event.experience() / event.setExperience(...) changeableExperience the beater's team shares for it (a blow in the world gives none: 0, and a change there gives none).

CaptureAttempt

server.events().on_capture_attempt(|event: &mut CaptureAttempt| ...)server.events().onCaptureAttempt((CaptureAttempt event) -> ...)

A cube thrown in the world is about to try to catch a Voxelmon. A cube used in a turn-based battle does not send it yet.

Can be stopped: the cube bounces off.

FieldDescription
event.player: PlayerPlayer event.player()Who threw it.
event.creature: CreatureCreature event.creature()The target.
event.chance: f64double event.chance() / event.setChance(...) changeableIts chance, 0 to 1.

CreatureCaptured

server.events().on_creature_captured(|event: & CreatureCaptured| ...)server.events().onCreatureCaptured((CreatureCaptured event) -> ...)

A Voxelmon was caught.

FieldDescription
event.player: PlayerPlayer event.player()Who caught it.
event.creature: CreatureCreature event.creature()The creature, now theirs.

CreatureLevelledUp

server.events().on_creature_levelled_up(|event: & CreatureLevelledUp| ...)server.events().onCreatureLevelledUp((CreatureLevelledUp event) -> ...)

A player's Voxelmon reached a new level.

FieldDescription
event.creature: CreatureCreature event.creature()The creature.
event.level: i64long event.level()Its new level.

CreatureEvolving

server.events().on_creature_evolving(|event: &mut CreatureEvolving| ...)server.events().onCreatureEvolving((CreatureEvolving event) -> ...)

A player's Voxelmon is about to evolve.

Can be stopped: it does not evolve this time.

FieldDescription
event.creature: CreatureCreature event.creature()The creature.
event.into: SpeciesSpecies event.into()What it will become.

CreatureEvolved

server.events().on_creature_evolved(|event: & CreatureEvolved| ...)server.events().onCreatureEvolved((CreatureEvolved event) -> ...)

A player's Voxelmon evolved.

FieldDescription
event.creature: CreatureCreature event.creature()The creature, now its new species.
event.from: SpeciesSpecies event.from()What it was.

CompanionSentOut

server.events().on_companion_sent_out(|event: & CompanionSentOut| ...)server.events().onCompanionSentOut((CompanionSentOut event) -> ...)

A player threw a cube and their Voxelmon came out.

FieldDescription
event.player: PlayerPlayer event.player()Its owner.
event.creature: CreatureCreature event.creature()The companion.

CompanionRecalled

server.events().on_companion_recalled(|event: & CompanionRecalled| ...)server.events().onCompanionRecalled((CompanionRecalled event) -> ...)

A player's companion went back into its cube.

FieldDescription
event.player: PlayerPlayer event.player()Its owner.
event.creature: CreatureCreature event.creature()The companion.

CreaturePetted

server.events().on_creature_petted(|event: & CreaturePetted| ...)server.events().onCreaturePetted((CreaturePetted event) -> ...)

A player petted their companion.

FieldDescription
event.player: PlayerPlayer event.player()Who petted it.
event.creature: CreatureCreature event.creature()The companion.

BattleStarting

server.events().on_battle_starting(|event: &mut BattleStarting| ...)server.events().onBattleStarting((BattleStarting event) -> ...)

A turn-based battle is about to begin, against a wild Voxelmon or a trainer.

Can be stopped: there is no battle.

FieldDescription
event.player: PlayerPlayer event.player()Who is battling.
event.kind: BattleKindBattleKind event.kind()Wild, trainer or boss.
event.opponents: Vec<Creature>List<Creature> event.opponents()What they face.

BattleStarted

server.events().on_battle_started(|event: & BattleStarted| ...)server.events().onBattleStarted((BattleStarted event) -> ...)

A battle began.

FieldDescription
event.battle: BattleBattle event.battle()The battle.

BattleTurn

server.events().on_battle_turn(|event: & BattleTurn| ...)server.events().onBattleTurn((BattleTurn event) -> ...)

A battle's turn was decided.

FieldDescription
event.battle: BattleBattle event.battle()The battle.
event.actions: Vec<TurnAction>List<TurnAction> event.actions()What each side did.

BattleEnded

server.events().on_battle_ended(|event: &mut BattleEnded| ...)server.events().onBattleEnded((BattleEnded event) -> ...)

A battle ended. It is sent when the result is decided (before the last turn's BattleTurn) or when the battle is called off.

FieldDescription
event.battle: BattleBattle event.battle()The battle (no longer readable: it has ended).
event.result: BattleResultBattleResult event.result()Won, lost, fled, caught or cancelled.
event.coins: i64long event.coins() / event.setCoins(...) changeableCoins paid by a beaten trainer.

ProfessionLevelledUp

server.events().on_profession_levelled_up(|event: & ProfessionLevelledUp| ...)server.events().onProfessionLevelledUp((ProfessionLevelledUp event) -> ...)

A player reached a new level in a profession.

FieldDescription
event.player: PlayerPlayer event.player()The player.
event.profession: ProfessionProfession event.profession()Which profession.
event.level: i64long event.level()The new level.

CoinsChanged

server.events().on_coins_changed(|event: & CoinsChanged| ...)server.events().onCoinsChanged((CoinsChanged event) -> ...)

A player's coins changed.

FieldDescription
event.player: PlayerPlayer event.player()The player.
event.before: i64long event.before()Coins before.
event.after: i64long event.after()Coins now.

TownFreed

server.events().on_town_freed(|event: & TownFreed| ...)server.events().onTownFreed((TownFreed event) -> ...)

A town's Voxelord was beaten and the town freed.

FieldDescription
event.town: TownTown event.town()The town.
event.players: Vec<Player>List<Player> event.players()Who took part.

DungeonBeaten

server.events().on_dungeon_beaten(|event: & DungeonBeaten| ...)server.events().onDungeonBeaten((DungeonBeaten event) -> ...)

A dungeon's guardian was beaten. players are those standing over the dungeon at that moment.

FieldDescription
event.dungeon: DungeonDungeon event.dungeon()The dungeon.
event.players: Vec<Player>List<Player> event.players()Who took part.

DungeonReset

server.events().on_dungeon_reset(|event: & DungeonReset| ...)server.events().onDungeonReset((DungeonReset event) -> ...)

A beaten dungeon reset: at the first dawn a full day after its guardian fell, with no player inside, its chests refilled and its guardian will return; or through Dungeon.reset.

FieldDescription
event.dungeon: DungeonDungeon event.dungeon()The dungeon.

DayStarted

server.events().on_day_started(|event: & DayStarted| ...)server.events().onDayStarted((DayStarted event) -> ...)

Dawn: a new day began.

FieldDescription
event.day: i64long event.day()The day's number.

NightStarted

server.events().on_night_started(|event: & NightStarted| ...)server.events().onNightStarted((NightStarted event) -> ...)

Dusk: night began.

FieldDescription
event.day: i64long event.day()The day's number.

WeatherChanged

server.events().on_weather_changed(|event: & WeatherChanged| ...)server.events().onWeatherChanged((WeatherChanged event) -> ...)

The weather changed in kind or strength (World.weather), because a spell of weather began or ended or a plugin set it.

FieldDescription
event.before: WeatherWeather event.before()What it was.
event.after: WeatherWeather event.after()What it is now.

WorldSaved

server.events().on_world_saved(|event: & WorldSaved| ...)server.events().onWorldSaved((WorldSaved event) -> ...)

The world was saved.

FieldDescription
event.automatic: boolboolean event.automatic()True for an autosave.

server.events().on_menu_pressed(|event: & MenuPressed| ...)server.events().onMenuPressed((MenuPressed event) -> ...)

A player pressed a button, tile or toggle on a plugin's Menu.

FieldDescription
event.player: PlayerPlayer event.player()Who pressed it.
event.menu: MenuMenu event.menu()The menu.
event.id: StringString event.id()The pressed element's id.
event.value: Option<Value>Optional<Value> event.value()A toggle's or slider's new value.

server.events().on_menu_closed(|event: & MenuClosed| ...)server.events().onMenuClosed((MenuClosed event) -> ...)

A player closed a plugin's menu, or walked away from it.

FieldDescription
event.player: PlayerPlayer event.player()Who closed it.
event.menu: MenuMenu event.menu()The menu.