dev.polymodloader.api.event.player
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
LoginCheckListener | functional interface | Listener for PlayerEvents.LOGIN_CHECK. |
PlayerCopyListener | functional interface | Listener for PlayerEvents.COPY. |
PlayerEvents | class | Player connection and respawn events, fired on the server thread of every server kind. |
PlayerJoinedListener | functional interface | Listener for PlayerEvents.JOINED. |
PlayerLeavingListener | functional interface | Listener for PlayerEvents.LEAVING. |
PlayerRespawnedListener | functional interface | Listener for PlayerEvents.RESPAWNED. |
LoginCheckListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface LoginCheckListener
Listener for PlayerEvents.LOGIN_CHECK.
checkLogin(UUID, String)
Optional<String> checkLogin(UUID playerId, String playerName)
Since 0.1.0-alpha.4 or earlier
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.
| Parameter | Type | Description |
|---|---|---|
playerId | UUID | — |
playerName | String | — |
Returns Optional<String>
PlayerCopyListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface PlayerCopyListener
Listener for PlayerEvents.COPY.
onPlayerCopy(PlayerView, PlayerView, boolean)
void onPlayerCopy(PlayerView oldPlayer, PlayerView newPlayer, boolean returnedFromEnd)
Since 0.1.0-alpha.4 or earlier
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.
| Parameter | Type | Description |
|---|---|---|
oldPlayer | PlayerView | the player object being replaced; valid only during the call |
newPlayer | PlayerView | the new player object, not yet in a world; valid only during the call |
returnedFromEnd | boolean | true when leaving the End (alive), false after death |
PlayerEvents
class · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public final class PlayerEvents
Player connection and respawn events, fired on the server thread of every server kind.
| Constant or field | Type | Description |
|---|---|---|
COPY | EventKey<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. |
RESPAWNED | EventKey<PlayerRespawnedListener> | A player respawned and the new player object is in its world. Fabric API: ServerPlayerEvents.AFTER_RESPAWN; NeoForge: PlayerEvent.PlayerRespawnEvent. |
JOINED | EventKey<PlayerJoinedListener> | A player finished joining the server and is in the world. |
LEAVING | EventKey<PlayerLeavingListener> | A player is about to be removed from the server (disconnect or kick). |
LOGIN_CHECK | EventKey<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
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface PlayerJoinedListener
Listener for PlayerEvents.JOINED.
onPlayerJoined(PlayerView)
void onPlayerJoined(PlayerView player)
Since 0.1.0-alpha.4 or earlier
Called on the server thread; player is valid only during the call.
| Parameter | Type | Description |
|---|---|---|
player | PlayerView | — |
PlayerLeavingListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface PlayerLeavingListener
Listener for PlayerEvents.LEAVING.
onPlayerLeaving(PlayerView)
void onPlayerLeaving(PlayerView player)
Since 0.1.0-alpha.4 or earlier
Called on the server thread before the player is removed; player is valid only during the call.
| Parameter | Type | Description |
|---|---|---|
player | PlayerView | — |
PlayerRespawnedListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface PlayerRespawnedListener
Listener for PlayerEvents.RESPAWNED.
onPlayerRespawned(PlayerView, boolean)
void onPlayerRespawned(PlayerView player, boolean returnedFromEnd)
Since 0.1.0-alpha.4 or earlier
Called on the server thread after the new player object was placed in its world.
| Parameter | Type | Description |
|---|---|---|
player | PlayerView | the new player; valid only during the call |
returnedFromEnd | boolean | true when the player left the End through the exit portal (alive), false after death |