Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What the HUD draws, and when

Verified against Minecraft 26.2 · Reference · Hand-kept from Hud.extractRenderState and Gui.extractRenderState.

The HUD is one ordered method, and almost every element in it is behind a condition — the contextual bar is the exception, recorded unconditionally and made to draw nothing by an empty state object instead. The lecture that frames this is the HUD; this is the table it is built on, in record order — which is also the order things appear in front of each other, since the GUI render tree infers layering from call order and bounding boxes.

Three gates sit above everything below and none of them belongs to Hud: GameRenderer.extract computes them — resources loaded, the frame advancing game time, a level existing — and Gui.extractRenderState is what applies them, calling into Hud only when they hold. Hud.extractRenderState then short-circuits entirely while a LevelLoadingScreen is up — but it publishes GuiRenderState.isHudHidden before that check, so the flag is always current even when nothing is recorded.

Hidden in the last column means Hud.isHidden, which Options.keyToggleGui — F1 — flips.

#elementrecorded byhidden by F1?its own condition
1vignetteHud.extractVignetteyesOptions.vignette is on
2spyglass overlayHud.extractSpyglassOverlayyesfirst-person camera and the player is scoping
3equipment camera overlayHud.extractTextureOverlayyesfirst-person, not scoping, and some equipped item’s Equippable declares a camera overlay for the slot it is in
4powder-snow outlineHud.extractTextureOverlayyesEntity.getTicksFrozen above zero
5portal overlayHud.extractPortalOverlayyesthe interpolated portal intensity is above zero
6nausea overlayHud.extractConfusionOverlayyeselse: no portal effect, a nausea blend above zero, and Options.screenEffectScale below one
7crosshairHud.extractCrosshairyesfirst-person; either not a spectator or a hit result a spectator may see; and the F3 three-dimensional-crosshair entry is off
new stratumGuiGraphicsExtractor.nextStratuma hard layering barrier — everything below is above everything above. Hud calls it ten times in all; this is the one that separates the overlays from the rest, and there is another inside the crosshair
8hotbarHud.extractItemHotbaryesa camera player exists — replaced by SpectatorGui.extractHotbar in spectator mode
9armourHud.extractArmoryesinside the health block, and LivingEntity.getArmorValue above zero
10heartsHud.extractHeartsyesinside the health block
11foodHud.extractFoodyesinside the health block, and the vehicle contributes no hearts
12air bubblesHud.extractAirBubblesyesinside the health block, and the player’s eyes are in water or the air supply is below its maximum
13mount healthHud.extractVehicleHealthyesa ridden LivingEntity with a non-zero heart count — outside the health block, so creative shows it
14contextual bar, backgroundContextualBar.extractBackgroundyesalways recorded, but which of four states it is in is re-decided every frame by Hud.nextContextualInfoState
15experience levelContextualBar.extractExperienceLevelyesthe game mode has experience and the level is above zero — recorded between the bar’s two passes, so it survives whichever bar wins
16contextual bar, foregroundContextualBar.extractRenderStateyesalways recorded; empty in ContextualBar.EMPTY, ExperienceBar and JumpableVehicleBar, so LocatorBar is the only one of the four states that draws anything here
17selected item nameHud.extractSelectedItemNameyesnot a spectator, Hud.toolHighlightTimer above zero, and the stack is not empty
18status effectsHud.extractEffectsyesthe player has effects, no screen is showing them itself, and the instance sets MobEffectInstance.showIcon
19boss barsBossHealthOverlayyesthe overlay has events
20sleep fadeHud.extractSleepOverlaynoPlayer.getSleepTimer above zero — the one element between the two hidden-gated blocks
21demo textHud.extractDemoOverlayyesMinecraft.isDemo
22scoreboard sidebarHud.displayScoreboardSidebaryesa display objective for the team’s colour slot, else for DisplaySlot.SIDEBAR
23action barHud.extractOverlayMessageyesHud.overlayMessageString is set and its timer has not run out
24title and subtitleHud.extractTitleyesHud.title is set and Hud.titleTime is above zero
25chatChatComponent.extractRenderStateyesa player exists and the chat screen is not focused
26tab listPlayerTabOverlay.extractRenderStateyesOptions.keyPlayerList is down, and either this is not a local server, or more than one player is listed, or a DisplaySlot.LIST objective exists
27subtitlesSubtitleOverlayOptions.showSubtitles is on and something audible is playingdeferred when there is no screen or the screen declares itself in-game UI — and recorded even while hidden, if a screen declaring itself in-game UI is up

The four elements a reader expects at the end of that list are not on Hud.extractRenderState’s list at all — three of them are still Hud methods, and only the toasts are outside Hud. Gui.extractRenderState records them, after the overlay or screen:

#elementits own conditionhidden by F1?
28saving indicatorOptions.showAutosaveIndicator is on, the frame is drawing a level, and a save is still animatingno
29toastsresources are loadedchecks the flag itself
30debug overlaythe current screen is not DebugOptionsScreenchecks the flag itself
31deferred subtitlesrow 27 deferred them — but only when no screen is up: a screen draws them itself from Screen.extractBackground, below its own widgets, and this call then finds nothing left

Two consequences worth carrying away. Toasts and the debug overlay are always above a screen, because Gui records them after it. And the deferred subtitles are called from a screen’s background pass, so they land under the screen’s widgets rather than over them.


Rules: names, never code · how the system works, not how the code reads · newest version only · every backticked name passes tools/verify_names.py.