Skip to content
On this page
通用

ScriptEntrypoint

top.katton.apicommon/src/main/kotlin/top/katton/api/ScriptEntrypoint.kt
Execution stages available to server entrypoints.

ServerPhase

ServerPhase通用枚举类
kotlin
enum class ServerPhase

Execution stages available to server entrypoints.

ServerPhase.BOOTSTRAP

ServerPhase.BOOTSTRAP通用
kotlin
BOOTSTRAP,

Early, process-lifetime initialization. Only GLOBAL packs may use this phase.

ServerPhase.READY

ServerPhase.READY通用
kotlin
READY

A server and its worlds are available. GLOBAL and WORLD packs may use this phase.

ClientPhase

ClientPhase通用枚举类
kotlin
enum class ClientPhase

Execution stages available to client entrypoints.

ClientPhase.READY

ClientPhase.READY通用
kotlin
READY,

One-time client initialization. Only GLOBAL packs may use this phase.

ClientPhase.REGISTRY_SETUP

ClientPhase.REGISTRY_SETUP通用
kotlin
REGISTRY_SETUP,

Client content registration before remote registry validation.

ClientPhase.JOINED

ClientPhase.JOINED通用
kotlin
JOINED

A client connection, player, and world are available.

InvocationReason

InvocationReason通用枚举类
kotlin
enum class InvocationReason

Whether an entrypoint is running for the first time or being replayed after a reload.

InvocationReason.INITIAL_LOAD

InvocationReason.INITIAL_LOAD通用
kotlin
INITIAL_LOAD,

The entrypoint is running for the first time at its lifecycle boundary.

InvocationReason.HOT_RELOAD

InvocationReason.HOT_RELOAD通用
kotlin
HOT_RELOAD

The entrypoint is replaying after an accepted script reload or synchronized revision.

ReloadCause

ReloadCause通用枚举类
kotlin
enum class ReloadCause

The operation that caused an entrypoint invocation.

ReloadCause.SERVER_START

ReloadCause.SERVER_START通用
kotlin
SERVER_START,

A server reached its ready lifecycle boundary.

ReloadCause.COMMAND

ReloadCause.COMMAND通用
kotlin
COMMAND,

A Katton command requested a script reload.

ReloadCause.DATAPACK_RELOAD

ReloadCause.DATAPACK_RELOAD通用
kotlin
DATAPACK_RELOAD,

Minecraft's datapack reload flow requested a script reload.

ReloadCause.SERVER_PACK_SYNC

ReloadCause.SERVER_PACK_SYNC通用
kotlin
SERVER_PACK_SYNC,

A client activated a server-authoritative script-pack snapshot.

ReloadCause.CLIENT_JOIN

ReloadCause.CLIENT_JOIN通用
kotlin
CLIENT_JOIN

A client connection gained its local player and level.

ScriptInvocationContext

ScriptInvocationContext通用接口
kotlin
sealed interface ScriptInvocationContext

Common metadata supplied to phase-aware entrypoints.

BootstrapContext

BootstrapContext通用数据类
kotlin
data class BootstrapContext( override val packId: String, override val scope: ScriptPackScope, override val reason: InvocationReason, override val cause: ReloadCause, override val platform: String ) : ScriptInvocationContext

Invocation metadata for [ServerPhase.BOOTSTRAP].

ServerReadyContext

ServerReadyContext通用数据类
kotlin
data class ServerReadyContext( override val packId: String, override val scope: ScriptPackScope, override val reason: InvocationReason, override val cause: ReloadCause, override val platform: String, val server: MinecraftServer ) : ScriptInvocationContext

Invocation metadata for [ServerPhase.READY], including the available [server].

ClientReadyContext

ClientReadyContext通用数据类
kotlin
data class ClientReadyContext( override val packId: String, override val scope: ScriptPackScope, override val reason: InvocationReason, override val cause: ReloadCause, override val platform: String, val client: Minecraft ) : ScriptInvocationContext

Invocation metadata for [ClientPhase.READY], including the available [client].

ClientRegistryContext

ClientRegistryContext通用数据类
kotlin
data class ClientRegistryContext( override val packId: String, override val scope: ScriptPackScope, override val reason: InvocationReason, override val cause: ReloadCause, override val platform: String, val client: Minecraft ) : ScriptInvocationContext

Invocation metadata for [ClientPhase.REGISTRY_SETUP], before remote registry validation.

ClientJoinedContext

ClientJoinedContext通用数据类
kotlin
data class ClientJoinedContext( override val packId: String, override val scope: ScriptPackScope, override val reason: InvocationReason, override val cause: ReloadCause, override val platform: String, val client: Minecraft, val player: LocalPlayer, val level: ClientLevel ) : ScriptInvocationContext

Invocation metadata for [ClientPhase.JOINED], including the available [player] and [level].

ClientScriptEntrypoint

ClientScriptEntrypoint通用注解类
kotlin
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FUNCTION)
annotation class ClientScriptEntrypoint( val phase: ClientPhase

Marks a top-level function as a client script entrypoint.

ServerScriptEntrypoint

ServerScriptEntrypoint通用注解类
kotlin
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FUNCTION)
annotation class ServerScriptEntrypoint( val phase: ServerPhase

Marks a top-level function as a server script entrypoint.