-
Bug
-
Resolution: Unresolved
-
None
-
1.19.4, 1.20 Release Candidate 1, 1.20, 1.20.1 Release Candidate 1, 1.20.1, 1.20.2 Pre-Release 4, 1.20.2 Release Candidate 1, 1.20.2, 23w44a, 1.20.3 Pre-Release 1, 1.20.3 Pre-Release 2, 1.20.4, 24w07a, 24w13a, 24w19b
-
None
-
Community Consensus
-
Resource Packs, Text, UI
-
Normal
-
Platform
Text display entities do not update their size when the resource pack is reloaded and the fonts are modified, causing the background to have an incorrect size and the text not to be centered around the display entity location.
This impacts servers which use custom fonts on text displays because players load the resource pack after joining.
Steps to reproduce
- Spawn a text display which uses a custom font (without the resource pack being enabled):
/summon minecraft:text_display ~ ~ ~ {text: '{"text": "Hello", "extra": [{"text": "-", "font": "testfont:space"}, {"text": "World"}]}'}
- Enable the attached resource pack (testfont.zip
).
- Observe that the text exceeds the width of the background and is not centered around the entity location correctly.
- Leave and rejoin the world.
- The text is now displayed correctly.
The attached resource pack contains the font testfont:space which makes the - character a wide space.
Analysis
The text width is cached in clientDisplayCache (Mojang mappings) in the Display.TextDisplay class. This cache is not invalidated when the resource pack is reloaded.