createMinecraftScreen

fun createMinecraftScreen(definition: UiDefinition, profile: MinecraftUiProfile, parent: Screen? = currentMinecraftScreen(), controls: RuntimeUiController? = null, eventSession: UiSession? = controls): FabricMinecraftScreen(source)

Creates a Fabric client screen by transferring definition into one independent common host.

Construction and every lifecycle and input callback belong on the Minecraft client thread. The returned screen retains but does not own parent; permanent abandonment requires explicit client-thread close.

Return

client-thread screen with terminal close ownership.

Parameters

definition

one-shot common screen definition.

profile

immutable asset profile.

parent

screen restored after terminal close.

Throws

when called away from the client thread or when definition cannot be transferred.

when host or screen construction fails; transferred ownership is released before failure escapes.


fun createMinecraftScreen(definition: ScreenDefinition, profile: MinecraftUiProfile, parent: Screen? = currentMinecraftScreen()): FabricMinecraftScreen(source)

Compatibility factory sharing the common UI host path.