FabricMinecraftScreen

class FabricMinecraftScreen : Screen, AutoCloseable, RuntimeUiDiagnosticsOwner, FabricMinecraftInputReset(source)

Fabric client screen backed by one common Minecraft UI host.

The host is created by transferring the one-shot ScreenDefinition and is confined to the Minecraft client thread. Added and removed screen callbacks attach and detach the retained tree; removal is transient and never closes the screen. Terminal close releases the host and screen-owned texture references; the independent device retires queued layers after their GUI-consumption fences. A caller that permanently abandons a removed or never-presented instance must close it on the client thread. The optional parent is retained for navigation but is never owned or closed. Rendering rasterizes portable command runs through the headless adapter and submits synchronized ItemStack commands through Minecraft's native extractor at their exact display-list positions. Mouse coordinates are floored after finite and integer-range checks. Horizontal scroll is forwarded unchanged, while vertical scroll is negated to match the common increasing-y contract.

See also

Properties

Link copied to clipboard
open val backgroundMusic: @Nullable Music?
Link copied to clipboard
open val currentFocusPath: @Nullable ComponentPath?
Link copied to clipboard
open var focused: @Nullable GuiEventListener?
Link copied to clipboard
open val font: Font?
Link copied to clipboard
var height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var isFocused: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val isPauseScreen: Boolean
Link copied to clipboard
open val narrationMessage: Component?
Link copied to clipboard
open val rectangle: ScreenRectangle?
Link copied to clipboard
open val tabOrderGroup: Int
Link copied to clipboard
open val title: Component?
Link copied to clipboard
var width: Int

Functions

Link copied to clipboard
open override fun added()

Attaches the common retained tree when Minecraft adds this screen.

Link copied to clipboard
Link copied to clipboard
open fun afterMouseAction()
Link copied to clipboard
open fun afterMouseMove()
Link copied to clipboard

Captures the last complete presentation from immutable CPU images and exact native-generation snapshots only.

Link copied to clipboard
Link copied to clipboard
open override fun charTyped(event: CharacterEvent): Boolean

Delivers one committed Unicode character to the focused retained component before inherited screen behavior.

Link copied to clipboard
open fun children(): List<out GuiEventListener?>?
Link copied to clipboard
open fun clearFocus()
Link copied to clipboard
open override fun close()

Releases host and texture ownership exactly once. A close requested synchronously from a common frame or input callback is deferred until that operation exits on the same client thread. This method does not navigate; a displayed screen must be replaced by Minecraft or closed through onClose, while a later onClose may still perform its one parent-navigation attempt.

Link copied to clipboard
open override fun extractBackground(graphics: GuiGraphicsExtractor, mouseX: Int, mouseY: Int, partialTick: Float)

Suppresses Minecraft's default panorama, blur, and menu-background extraction.

Link copied to clipboard
open override fun extractRenderState(graphics: GuiGraphicsExtractor, mouseX: Int, mouseY: Int, partialTick: Float)

Extracts one render state from the common frame and presents it at the logical GUI origin.

fun extractRenderStateWithTooltipAndSubtitles(graphics: GuiGraphicsExtractor?, mouseX: Int, mouseY: Int, a: Float)
Link copied to clipboard
open fun extractTransparentBackground(graphics: GuiGraphicsExtractor?)
Link copied to clipboard
open fun getBorderForArrowNavigation(opposite: ScreenDirection?): ScreenRectangle?
Link copied to clipboard
open fun getChildAt(x: Double, y: Double): Optional<GuiEventListener?>?
Link copied to clipboard
Link copied to clipboard
fun init(width: Int, height: Int)
Link copied to clipboard
open fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open override fun isPauseScreen(): Boolean

Reports whether this screen pauses the game according to its transferred definition.

Link copied to clipboard
open override fun keyPressed(event: KeyEvent): Boolean

Preserves Minecraft's screen-level Escape handling before delivering other key presses to the focused retained component and then inherited focus-navigation behavior.

Link copied to clipboard
open override fun keyReleased(event: KeyEvent): Boolean

Delivers a native key release to the focused retained component before inherited screen behavior.

Link copied to clipboard
open override fun mouseClicked(event: MouseButtonEvent, doubleClick: Boolean): Boolean

Delivers a native mouse press to the common host.

Link copied to clipboard
open override fun mouseDragged(event: MouseButtonEvent, deltaX: Double, deltaY: Double): Boolean

Delivers native movement while a mouse button is held as one typed common drag event.

Link copied to clipboard
open override fun mouseMoved(mouseX: Double, mouseY: Double)

Delivers a finite mouse movement to the common host.

Link copied to clipboard
open override fun mouseReleased(event: MouseButtonEvent): Boolean

Delivers a native mouse release to the common host.

Link copied to clipboard
open override fun mouseScrolled(mouseX: Double, mouseY: Double, deltaX: Double, deltaY: Double): Boolean

Delivers native scroll displacement after mapping vertical sign into the common coordinate contract.

Link copied to clipboard
open fun nextFocusPath(navigationEvent: FocusNavigationEvent?): @Nullable ComponentPath?
Link copied to clipboard
open override fun onClose()

Closes the host and always navigates to the transferred parent screen.

Link copied to clipboard
open fun onFilesDrop(files: List<Path?>?)
Link copied to clipboard
open override fun preeditUpdated(event: PreeditEvent?): Boolean

Delivers one input-method preedit snapshot to the focused retained component before inherited screen behavior.

Link copied to clipboard
open override fun removed()

Detaches the common retained tree while retaining it for a later add callback. Detached screens release their prepared display list and texture references so a parent screen cannot retain presentation-only data while hidden. The independent device preserves already queued native layers through their actual consumption fences.

Link copied to clipboard
open override fun resetInputFromNative()

Cancels captured pointer, hover, and focus state after a native window/input reset.

Link copied to clipboard
open fun resize(width: Int, height: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun tick()
Link copied to clipboard
open fun triggerImmediateNarration(onlyChanged: Boolean)
Link copied to clipboard
open fun updateNarratorStatus(wasDisabled: Boolean, narrationTrigger: NarrationTrigger?)