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 does not evaluate content. The parent defaults to the active Minecraft GUI screen through the version-specific screen access boundary. Construction and every screen lifecycle and input callback belong on the Minecraft client thread; wrong-thread host operations preserve the common host failure contract. The returned screen retains but does not own parent; permanent abandonment requires explicit client-thread close.

Return

a client-thread screen with terminal close ownership.

Parameters

definition

the one-shot common screen definition.

profile

the immutable asset profile.

parent

the screen restored by FabricMinecraftScreen.onClose.

Throws

when called away from the Minecraft client thread or when definition was already transferred or closed.

when title conversion, host construction, or private 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.