mojira.dev
MC-6866

Text can extend beyond the edges of some GUIs

The Bug:

Text can extend beyond the edges of some GUIs.

For a bit of context, this issue can be seen within the chest GUI, shulker box GUI, named entity GUIs, etc...

Steps to Reproduce:

  1. Give yourself a chest with a custom name that's relatively long by using the command provided below.

    /give @s minecraft:barrel[minecraft:custom_name="MC-6866 MC-6866 MC-6866 MC-6866 MC-6866"]
  2. Place down the chest, open it, and look at the title within its GUI.

Observed Behavior:

Text can exceed the right edges of some GUIs.

Expected Behavior:

The text would be truncated with an ellipsis.

Linked issues

Attachments

Comments 15

I should mention that you don't hit the limit even with 30 characters if you use narrow ones such as i. Rather than reducing the maximum length of name, perhaps the same width calculation books perform could be used to determine what is or is not too long?

This is similar to the bug with ~ on signs, and I doubt anybody would ask them to reduce the maximum amount of characters that can go on a sign.

Confirmed for 1.9-pre1

Still an issue in 16w33a

What exactly would be a correct behaviour?

  • Only allow 28 symbols for everything in an anvil?

  • Only allow 28 symbols if the item is a chest?

  • Make the font a bit smaller with there are 29 or 30 symbols as the chest's name?

  • Cut off the last two symbols?

  • Give out an additional warning in the anvil?

  • ...

5 more comments

Can confirm in 21w05b.

I'd like to request ownership of this ticket since the current reporter has been inactive for over a year. I'm willing to keep this ticket updated and will continue to provide all of the necessary details.

Can confirm in 1.18.2. Plus it also happens on the horse inventory GUI, as shown in MC-248880

This actually affects pretty much every gui, and translations can be problematic because of this.

Suggested fix: make text scroll, just like UI buttons/sliders.

This became a concern for translations as boats now use the full item name due to the fix of MC-256466. Minecart variants also now use item names instead of entity names (which could be shortened as they are only seen in command suggestion tooltips otherwise). As said by Dhranios, an ideal fix would be having scrolling text at least in GUI titles and status effect bars in the inventory.

Flasheek

Avoma

(Unassigned)

Confirmed

Platform

Low

UI

Snapshot 13w02a, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.2, Snapshot 13w18c, ..., 25w08a, 1.21.5, 1.21.6, 1.21.7, 1.21.8

Retrieved