본문으로 건너뛰기
버전: Minecraft 26.2

dev.polymodloader.api.event.player

자동 생성

이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.

형식종류설명
LoginCheckListener함수형 인터페이스Listener for PlayerEvents.LOGIN_CHECK.
PlayerCopyListener함수형 인터페이스Listener for PlayerEvents.COPY.
PlayerEvents클래스Player connection and respawn events, fired on the server thread of every server kind.
PlayerJoinedListener함수형 인터페이스Listener for PlayerEvents.JOINED.
PlayerLeavingListener함수형 인터페이스Listener for PlayerEvents.LEAVING.
PlayerRespawnedListener함수형 인터페이스Listener for PlayerEvents.RESPAWNED.

LoginCheckListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface LoginCheckListener

Listener for PlayerEvents.LOGIN_CHECK.

checkLogin(UUID, String)​

Optional<String> checkLogin(UUID playerId, String playerName)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Returns a reason to refuse the player, shown on their disconnect screen, or empty to let them in. Runs after the game's own ban and whitelist checks passed, before the player exists.

인자타입설명
playerIdUUID—
playerNameString—

반환 Optional<String>

PlayerCopyListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface PlayerCopyListener

Listener for PlayerEvents.COPY.

onPlayerCopy(PlayerView, PlayerView, boolean)​

void onPlayerCopy(PlayerView oldPlayer, PlayerView newPlayer, boolean returnedFromEnd)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread while the game builds the new player object for a respawn, after the game copied what it keeps (inventory with keepInventory, everything when returning from the End) and after Poly Mod Loader copied EntityDataKey data. Copy anything else the mod keeps per player object here.

인자타입설명
oldPlayerPlayerViewthe player object being replaced; valid only during the call
newPlayerPlayerViewthe new player object, not yet in a world; valid only during the call
returnedFromEndbooleantrue when leaving the End (alive), false after death

PlayerEvents​

클래스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public final class PlayerEvents

Player connection and respawn events, fired on the server thread of every server kind.

상수·필드타입설명
COPYEventKey<PlayerCopyListener>The game is building the new player object for a respawn (after death or when leaving the End) and copying data from the old one. Fabric API: ServerPlayerEvents.COPY_FROM; NeoForge: PlayerEvent.Clone.
RESPAWNEDEventKey<PlayerRespawnedListener>A player respawned and the new player object is in its world. Fabric API: ServerPlayerEvents.AFTER_RESPAWN; NeoForge: PlayerEvent.PlayerRespawnEvent.
JOINEDEventKey<PlayerJoinedListener>A player finished joining the server and is in the world.
LEAVINGEventKey<PlayerLeavingListener>A player is about to be removed from the server (disconnect or kick).
LOGIN_CHECKEventKey<LoginCheckListener>A player is logging in (after authentication and the game's ban, whitelist, and player-limit checks); any listener may refuse them. Fired on the server thread.

PlayerJoinedListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface PlayerJoinedListener

Listener for PlayerEvents.JOINED.

onPlayerJoined(PlayerView)​

void onPlayerJoined(PlayerView player)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread; player is valid only during the call.

인자타입설명
playerPlayerView—

PlayerLeavingListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface PlayerLeavingListener

Listener for PlayerEvents.LEAVING.

onPlayerLeaving(PlayerView)​

void onPlayerLeaving(PlayerView player)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread before the player is removed; player is valid only during the call.

인자타입설명
playerPlayerView—

PlayerRespawnedListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface PlayerRespawnedListener

Listener for PlayerEvents.RESPAWNED.

onPlayerRespawned(PlayerView, boolean)​

void onPlayerRespawned(PlayerView player, boolean returnedFromEnd)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread after the new player object was placed in its world.

인자타입설명
playerPlayerViewthe new player; valid only during the call
returnedFromEndbooleantrue when the player left the End through the exit portal (alive), false after death
Buy me a coffee