mojira.dev
MC-106167

/title actionbar does not respect /title times

The bug

The actionbar messages that appear when using /title actionbar do not obey the fadeIn, stay, and fadeOut parameters when specified with /title times like the normal titles and subtitles do.

How to reproduce

Run the following commands in order:

/title @a times 100 100 100
/title @a title {"text":"Hello world!"}
/title @a actionbar {"text":"Hello world!"}

Note: The large title fades in and out very slowly and stays plastered on the screen for the full duration, but the actionbar text instantly appears and fades out after a fixed time at a constant rate, disregarding the title times.

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

Comments 40

This bug still exists in the Minecraft 1.11 release

Confirmed for 1.11.2. I thought I was doing something wrong! Very confusing.

Is still present in 1.13 snapshots

It's still not resolved in 1.13.2

Still not resolved on 19w11a

30 more comments

Can confirm in 22w18a.

This issue still exists in Minecraft snapshot 23w07a.

Code analysis (Yarn mappings)

The InGameHud#setOverlayMessage method is called on the client when a packet is sent by /title for the action bar/overlay. This method sets the InGameHud#overlayRemaining field to 60 rather than the current value of InGameHud#titleStayTicks, which is 70 by default.

In general, the title and subtitle use a single InGameHud#titleRemainTicks field to calculate the transparency of the title and subtitle. However, the overlay uses the InGameHud#overlayRemaining field in addition to hardcoded values for calculating its transparency.

The recommended fix would be to extract the transparency calculation based on InGameHud#titleRemainTicks to its own method that can be reused with InGameHud#overlayRemaining for the overlay. However, the overlay would be shown for 70 ticks rather than the current 60. In addition, existing overlay messages would match the title and subtitle timings if not modified. If these potential issues are not ideal, then the three timing fields can be separated into three for the title and subtitle and three for the overlay, with the latter being adjusted to the current values. The command format would need to be changed to handle this separation as well.

This issue still exists in Minecraft 1.19.4 release candidate 3.

Can confirm in 1.21.4.

tryashtar

(Unassigned)

Confirmed

Platform

Low

Commands, UI

/title, action-bar, command, fade, times

Minecraft 1.10.2, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w36a, ..., 1.19.4, 1.20.2, 1.20.4, 24w13a, 1.21.4

Retrieved