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
is duplicated by 4
relates to 2
Comments 40
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 bug still exists in the Minecraft 1.11 release