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

dev.polymodloader.api.event.server

자동 생성

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

형식종류설명
ServerEvents클래스Server lifecycle events.
ServerStartedListener함수형 인터페이스Called on the server thread once, before the server's first tick.
ServerStartingListener함수형 인터페이스Called on the server thread once per server start, after registries and data packs are loaded and before the worlds are created.
ServerStoppedListener함수형 인터페이스Called on the server thread once when the server has stopped: players were saved and removed, worlds were saved and closed.
ServerStoppingListener함수형 인터페이스Called on the server thread when the server begins to stop, before worlds are saved.
ServerTickListener함수형 인터페이스Called on the server thread at the start of every server tick (20 times per second).
ServerView인터페이스Read-only view of a running Minecraft server (dedicated, integrated, or game test).

ServerEvents​

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

public final class ServerEvents

Server lifecycle events. Fired for dedicated, integrated (single player), and game test servers, in this order: STARTING, STARTED, TICK (repeatedly), STOPPING, STOPPED. Fabric API: ServerLifecycleEvents; NeoForge: ServerStartingEvent and its siblings.

상수·필드타입설명
STARTINGEventKey<ServerStartingListener>The server is starting: registries and data packs are loaded, worlds are about to be created.
STARTEDEventKey<ServerStartedListener>The server finished starting and is about to process its first tick.
TICKEventKey<ServerTickListener>A server tick begins.
STOPPINGEventKey<ServerStoppingListener>The server begins to stop.
STOPPEDEventKey<ServerStoppedListener>The server stopped: players and worlds were saved and the worlds closed.

ServerStartedListener​

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

public interface ServerStartedListener

Called on the server thread once, before the server's first tick.

onServerStarted(ServerView)​

void onServerStarted(ServerView server)

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

Handles the event.

인자타입설명
serverServerView—

ServerStartingListener​

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

public interface ServerStartingListener

Called on the server thread once per server start, after registries and data packs are loaded and before the worlds are created. Worlds are not available yet; use WorldEvents.LOADED for them.

onServerStarting(ServerView)​

void onServerStarting(ServerView server)

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

Handles the event.

인자타입설명
serverServerView—

ServerStoppedListener​

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

public interface ServerStoppedListener

Called on the server thread once when the server has stopped: players were saved and removed, worlds were saved and closed. A good moment to release what the mod kept for this server; on the client the next single-player world starts a new server.

onServerStopped(ServerView)​

void onServerStopped(ServerView server)

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

Handles the event.

인자타입설명
serverServerView—

ServerStoppingListener​

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

public interface ServerStoppingListener

Called on the server thread when the server begins to stop, before worlds are saved.

onServerStopping(ServerView)​

void onServerStopping(ServerView server)

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

Handles the event.

인자타입설명
serverServerView—

ServerTickListener​

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

public interface ServerTickListener

Called on the server thread at the start of every server tick (20 times per second). Keep it fast.

onServerTick(ServerView)​

void onServerTick(ServerView server)

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

Handles the event.

인자타입설명
serverServerView—

ServerView​

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

public interface ServerView

Read-only view of a running Minecraft server (dedicated, integrated, or game test). Only valid while the listener that received it runs; do not keep it.

tickCount()​

int tickCount()

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

Ticks processed so far.

반환 int

playerCount()​

int playerCount()

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

Players currently connected.

반환 int

motd()​

String motd()

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

Message of the day shown in the server list.

반환 String

dedicated()​

boolean dedicated()

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

Whether Minecraft reports this server as dedicated. The client's integrated server and Mojang's game test server report false.

반환 boolean

Buy me a coffee