Text and localization
Text is drawn by label controls. A label gets its characters in three ways: a literal ("text": "Hello"), a variable ("text": "$title") or a binding ("text": "#form_text"). By default it is localized: the text is looked up as a translation key first and printed as is if there is none (TXT-01).
The smallest examples
Example 1. Literal, translation and color codes.
"title_label": { "type": "label",
"text": "my_pack.title",
"font_type": "smooth", "font_size": "large", "color": [ 1, 0.8, 0.2 ],
"shadow": true, "text_alignment": "center" }
Define the key in RP/texts/ko_KR.lang. For a language without the value, it falls back to en_US (TXT-10).
my_pack.title=§l나의 팩
Example 2. Printing bound text as is. For text that must not be translated, such as user input, chat and titles, give localize: false.
"form_title": { "type": "label", "localize": false, "text": "#title_text",
"bindings": [ { "binding_type": "global", "binding_name": "#title_text" } ] }
Example 3. A number as text. A label cannot draw a numeric binding directly, so join it to a string (TXT-06).
{ "binding_type": "view", "source_property_name": "('Score: ' + #score)", "target_property_name": "#text" }
Label property table (MS Learn and the Bedrock Wiki)
This combines the Text tables of the MS Learn ui_element reference (ms-learn a9fd1c0) and the Bedrock Wiki JSON UI Documentation (0930b39). Defaults follow the wiki table, and the default of localize is true (TXT-01).
| Property | Type | Meaning |
|---|---|---|
text | string | The text. A literal, #binding, $variable or translation key |
color | [r, g, b] (0.0~1.0) | Text color. Default [1, 1, 1] |
locked_color, locked_alpha | color, real number | The color and opacity when the parent is enabled: false |
shadow | boolean | Text shadow |
font_size | small, normal, large, extra_large | Text size. Default normal. The scales are 0.5, 1, 2 and 4 in that order, and medium draws as normal (TXT-05) |
font_scale_factor | real number | Text scale. Default 1.0. Multiplies the font_size scale (TXT-26). The MS Learn table wrongly lists the type as boolean |
font_type | default, rune, unicode, smooth, MinecraftTen or a custom font | Font |
backup_font_type | font | The font to use when font_type does not work |
localize | boolean | Whether to translate text |
line_padding | number | Line spacing. Added to every line (TXT-27) |
hide_hyphen | boolean | Hides the hyphen produced when wrapping a word |
enable_profanity_filter | boolean | Profanity filter |
text_alignment | left, center, right | Alignment. If not specified, automatic according to anchor_from and anchor_to |
notify_on_ellipses | string array | The names of controls to notify when an ellipsis appears or disappears. Those controls read #using_ellipses |
wrap, clip | boolean | Old properties the wiki marks as "no longer working" |
notify_on_ellipses is mainly used for hardcoded text. If you give a label "notify_on_ellipses": [ "my_button" ] and my_button binds "source_property_name": "#using_ellipses" to #visible, the button shows only when the text is cut off (the wiki example, TXT-16).
Label basics
- [TXT-01] A label is localized by default. It looks up the text as a translation key first and prints it as is if there is none. For text that must be printed as a literal (user input, chat, titles, etc.), give
"localize": false. When vanilla useslocalizeit almost always usesfalse(31 to 1).{measured, vanilla}(Source: BC-facts, VN, BW-doc) - [TXT-02] Main label properties:
text(literal,#binding,$variable),color,font_type,font_size,font_scale_factor,text_alignment(left,center,right),shadow,enable_profanity_filter,localize.{vanilla}(Source: VN hud_screen.json:2287-2310, Appendix B) - [TXT-03] The
font_typevalues aredefault,smooth,rune,unicodeandMinecraftTen. Vanilla mainly usessmooth(193) andMinecraftTen(21). Using an internal font name such asMinecraftSevendraws nothing with no error.{measured, vanilla}(Source: BC 6.6-6, BC-S7, VN) - [TXT-04]
#font_typeis an engine-reserved property, so it is validated the moment it is used. A wrong alias is logged line by line inNonAssertErrorLogand blocks marketplace submission.{code (source)}(Source: BC 6.6-7) - [TXT-05]
font_sizehas four values,small,normal,largeandextra_large, with scales 0.5, 1, 2 and 4 in that order. On Windows 1.26.65.1 "Ab" drew as small 6x5, normal 12x10, large 24x20 and extra_large 48x40, and on 2026-11-24 a "Hg" label gave the same label boxes with glyphs growing in the same ratio. In the code the text size of a draw request is this table value xfont_scale_factor, and drawing scales the transform matrix by this size x the font scale, so the table value multiplies the glyph size directly.mediumis not a size value and draws asnormal. The engine'sfont_sizetable has nomediumand reads an unknown value asnormal. So themediumthat vanilla uses 4 times is the same asnormal.{measured, code (binary), vanilla}(Source: VN, Appendix B, 2026-11-20 Windows 1.26.65.1 measurement and decompilation, 2026-11-24 Windows 1.26.65.1 measurement and decompilation) - [TXT-06] A label cannot draw a numeric binding as is. Join it to a string and bind it to
text:('n=' + #raw). Only integers join, and in string + float the float part is empty and only the string is left (('D ' + float)gives'D ', EXP-22). On Windows 1.26.65.1 too, a number or boolean alone in#textshowed nothing,'R' +an integer showed the digits, and'R' +a float left onlyR(measurement record).{measured}(Source: BC-facts, BC 6.6-5, BW-type) - [TXT-07] An empty label, or a
defaultsize label containing only§r, still has a height of one line. It does not collapse to 0, so to remove a row, hide it with#visible.{measured}(Source: BC-S10) - [TXT-08]
§color codes are kept in bound text too. Vanilla_global_variables.jsondefines the 16 colors§0to§fas$0_color_format…$f_color_format, so you can write"color": "$f_color_format". Counting the colors of§gto§w, there are 29 color code variables, and the color of§wis$party_blue_color(TXT-24).{measured, vanilla, working pack}(Source: BC-S7, VN _global_variables.json:247, AP 4.9) - [TXT-24] The actual colors of
§color codes are built from 29 variables inui/_global_variables.json:$0_color_formatto$f_color_format,$coin_color(§g),$material_quartz_color,iron,netherite,redstone,copper,gold,emerald,diamond,lapis,amethystandresin(§hto§v), and$party_blue_color(§w). So to use the§wcolor in a labelcolor, use$party_blue_color. If a pack changes these variables, the§colors appear to change too, but this was not checked in game. The mapping between variables and codes was judged from the order and vanilla comments.{code (binary), inferred}(Source: NB-11, VN _global_variables.json:238-312) - [TXT-16] Label helper properties:
line_padding(line spacing, vanilla 14),backup_font_type(4),hide_hyphen(3),locked_colorandlocked_alpha(when the parent isenabled: false, 4 and 17),notify_on_ellipses(when an ellipsis appears or disappears,#using_ellipsesof the specified control changes, 4).{vanilla}(Source: BW-doc Text table, VN) - [TXT-26]
font_scale_factormultiplies thefont_sizescale. A label withfont_scale_factor: 2drew at twice thenormalsize.{measured, code (binary)}(Source: 2026-11-20 Windows 1.26.65.1 measurement and decompilation) - [TXT-27]
line_paddingis added to every line. Anormallabel holding"a\nb"was 20 high withoutline_paddingand 28 high withline_padding: 4.{measured, code (binary)}(Source: 2026-11-20 Windows 1.26.65.1 measurement and decompilation) - [TXT-28] A label narrower than its text cuts the text and ends it with an ellipsis. A label 30 wide drew
abcd....{measured}(Source: 2026-11-20 Windows 1.26.65.1) - [TXT-29] A color code (
§a) does not turn off bold (§l). Bold is reset only by§r. An uppercase code (§C) has no effect and disappears. The shadow was still drawn on text with format codes.{measured}(Source: 2026-11-20 Windows 1.26.65.1) - [TXT-22] A hover box drawn directly next to a cell was clipped by the scroll window. If you put vanilla
common.hover_text(hover_text_renderer) as a child of the button's hover state and put the button text in#hover_text, it appears next to the pointer without being clipped. With$hover_text_max_widthat 0, lines break only at\nin the text, and at 150 Hangul broke at about five characters.{measured}(Source: DF)
TXT-26~TXT-29 are code read by decompiling the native client (Windows 1.26.65.1, partly Android 1.26.52.3) and checked in the Windows 1.26.65.1 game (2026-11-20). The test window is juc_tester.json in the add-on addons/json-ui-claims. Sizes were judged from the ui_tree rectangles (GUI units) and the look of the text from screenshots.
lang files and key assembly
- [TXT-09] Send only a number and let the RP do the translation. Attach a key prefix to a piece cut out of the data string and put it in a
localize: truelabel:('myui.toast.' + #category). The script sends only fixed-width numbers (padded with 0). AP, which supports 28 languages, works this way.{working pack}(Source: AP 4.5, BA chapter 6) - [TXT-10] lang value rules: if the value is empty (
key=), the key itself is printed. If a language file lacks the key, the en_US value is printed. If the value is only§r, nothing is drawn and the width is also 0. Spaces around a value are kept. But if the whole value is a single space, the parser erases it and it becomes an undefined key. If you need a single space, wrap it as§r §r.{measured}(Source: BC-S10, BC-facts) - [TXT-11] Properties of server form entry strings: the
§color codes are kept, starting with a digit is no problem, even 200 characters work, a bare translation key string is not translated by the engine, and a RawMessage ({ rawtext: [...] }) is translated into the player's language by the client and put into the binding. So a sentence made of several translation keys can also be sent as one entry.{measured}(Source: BC-S7, BC 4.1-(4)) - [TXT-12] To write text on a surface that cannot handle text directly (a chest slot), convert the number to a lang key and the lang key to a character. Make the slot stack count n into the key
('core.ui.c.' + #count)and putcore.ui.c.<n>=<character>in.lang. A count of 1 leaves#inventory_stack_countempty, so set it to a space character.{measured, code (source)}(Source: BC 4.3-(3), BC-facts) - [TXT-13]
'%.Ns'is in bytes, so cutting a Hangul field in the middle breaks the character (EXP-09). Fixed-width fields that contain Hangul are padded by the encoder with UTF-8 bytes. The color code§is 2 bytes and most emoji are 4 bytes (EXP-24). On Windows 1.26.65.1§was cut as 2 bytes, Hangul as 3 and emoji as 4, and a cut in the middle of a character also dropped the character concatenated right after it (measurement record).{measured, code (source)}(Source: BA 3.1, BW-intro) - [TXT-14] When hardcoding a lang key, such as for an empty-screen message, a typo in the key name shows up only as the key itself printed on the screen (
_r4ui:ancements.emptyin AP v4.2). Compare the lang file and the key list mechanically.{working pack, inferred}(Source: AP chapter 5) - [TXT-25] The engine builds a slot's
#inventory_stack_countas text in advance: count 0 (empty slot) and 1 are empty text, 2 to 99 are the number, and 100 or more is99+. So this value cannot tell count 1 from an empty slot; check emptiness separately with another binding such as#item_id_aux(TXT-12, EXP-17). This was read from the Windows 1.26.63 client and not measured separately in game.{code (binary)}(Source: NB) - [TXT-15] A string put into vanilla
common.hover_textthrough#hover_textofproperty_bagis not localized. If translation is needed, make the tooltip label yourself.{unverified}(Source: BW-btn) - [TXT-17] If the text of a localized label has
%, each%token(letters, digits,-,.,_) is translated separately, and a token that does not exist is left as literal text. So the%in text like"50%"disappears. To show%, uselocalize: false.{code (source)}(Source: CN) - [TXT-23] When a scoreboard line label went through translation,
%disappeared (TXT-17 confirmed in game).localize: false.{measured}(Source: DF)
How evidence is marked and source abbreviations
A rule carries an ID in the form [chapter abbreviation-number], and the {…} at the end is the verification level. The priority of verdicts is measured > vanilla > working pack > code > inferred, and unverified and conflict must be checked before use. C-nn is a number in the conflict table, and the value counts of VN are the tallies in the value dictionary. Rule IDs of other chapters (LAY-, BND-, HOST-, etc.) are on the corresponding pages of the same JSON UI chapter.
| Abbreviation | Material |
|---|---|
VN | Exhaustive search of vanilla resource pack resource_pack/ui v1.26.50.4 (bedrock-samples 46ba6ea). VN file:line is that location |
BC, BC-S1~BC-S14, BC-facts, BC-rules | bedrock-core (@bedrock-core/ui 0.12.1, MIT) and the author's in-game measurement records (aee2bbd) |
BA, BA-original | BedrockAdvancements 2.0.3 (All rights reserved, only techniques carried over) |
AP | AdvancementPack v4.2 (MIT) |
MJ | mcbejsonuimasterAI (no license, only facts rechecked against vanilla) |
BW, BW-intro, BW-dyn, BW-doc, BW-form, BW-btn, BW-type, BW-best, BW-title, BW-ase, BW-ids | Bedrock Wiki JSON UI documents (CC BY 4.0). Respectively Intro to JSON UI, Dynamic Content Generation, JSON UI Documentation, Modifying Server Forms, Buttons and Toggles, Type Conversion, Best Practices, Preserve Title Texts, Aseprite Animations, Numerical Item IDs |
CN, CN-run | Cinnabar (Rust code reconstructing the 26.30 native client) and the results of this project running its evaluator. If it differs from game measurement, follow measurement |
NB | Engine behavior analysis of the Android 1.26.52.3 native client library (level code) |
DF | Measurement on Windows 1.26.52 with the research server (a structure that draws several screens with one server form) |
ASJ, SLB | AsaJS analysis, StarLibV2 analysis (both GPL-3.0, only techniques rewritten in English) |
MS | The modal form multiselect survey |
NE | NetEase (China edition) developer documentation |
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 | |
bedrock-samples | Mojang bedrock-samples | Minecraft EULA applies, (c) Mojang AB. All rights reserved | 15701fa9 (guide baseline 46ba6ea) | 2026-11-13 |
bedrock-wiki | Bedrock Wiki | CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) | 0930b39 | 2026-11-13 |
ms-learn | Minecraft Creator documentation (Microsoft Learn) | CC BY 4.0 (documentation), MIT (code) | a9fd1c0 | 2026-11-13 |
private-research | Private research (-) | - | 2026-11-13 | |
bedrock-core | bedrock-core UI (@bedrock-core/ui) | MIT (confirmed in the repository LICENSE, Copyright 2026 bedrock-core) | aee2bbd (analysis baseline, clone HEAD 51d5cf2) | 2026-11-13 |
advancementpack | AdvancementPack (r4isen1920) | MIT (confirmed in the repository LICENSE, Copyright 2024 r4isen1920) | 0a79929 (analyzed v4.2, researched 2026-10-20) | 2026-11-13 |
cinnabar | Cinnabar (json-ui crate) | PolyForm Noncommercial License 1.0.0 (confirmed in the repository LICENSE). Used only to check behavior and as an implementation reference; the original text is not copied | ceb0fb6 (analysis baseline, clone HEAD df826f5) | 2026-11-13 |