The PlayerGameModeChangeAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
Extended by PlayerGameModeChangeBeforeEvent
import type { PlayerGameModeChangeAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.playerGameModeChange.
Example
Section titled “Example”import { world, type PlayerGameModeChangeAfterEvent } from '@minecraft/server';
world.afterEvents.playerGameModeChange.subscribe((event: PlayerGameModeChangeAfterEvent) => { console.log('playerGameModeChange', event.player.name, event.fromGameMode, event.toGameMode);});import { world } from '@minecraft/server';
world.afterEvents.playerGameModeChange.subscribe((event) => { console.log('playerGameModeChange', event.player.name, event.fromGameMode, event.toGameMode);});Properties
Section titled “Properties”player
Section titled “player”read-only
readonly player: Player;Types
fromGameMode
Section titled “fromGameMode”read-only
readonly fromGameMode: GameMode;Types
toGameMode
Section titled “toGameMode”read-only
readonly toGameMode: GameMode;Types
Used by
Section titled “Used by”WorldAfterEvents.playerGameModeChange, PlayerGameModeChangeAfterEventSignal.subscribe, PlayerGameModeChangeAfterEventSignal.unsubscribe