The PlayerJoinAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { PlayerJoinAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.playerJoin.
Example
Section titled “Example”import { world, type PlayerJoinAfterEvent } from '@minecraft/server';
world.afterEvents.playerJoin.subscribe((event: PlayerJoinAfterEvent) => { console.log('playerJoin', event.playerId, event.playerName);});import { world } from '@minecraft/server';
world.afterEvents.playerJoin.subscribe((event) => { console.log('playerJoin', event.playerId, event.playerName);});Properties
Section titled “Properties”playerId
Section titled “playerId”read-only
readonly playerId: string;playerName
Section titled “playerName”read-only
readonly playerName: string;Used by
Section titled “Used by”WorldAfterEvents.playerJoin, PlayerJoinAfterEventSignal.subscribe, PlayerJoinAfterEventSignal.unsubscribe