In the @minecraft/server module, the Block class supports a localizationKey property intended to be used for displaying localized text to players using raw text. Unfortunately, this property does not respect the minecraft:display_name block component, which results in localization attempts being invalid.
Demonstration
Below shows (correct) information about a Vanilla block as reported by scripting:
The following shows (correct) localization of a custom block without the display name component:
Finally, here is (incorrect) localization information for a custom block with the display name component:
This custom block had used "minecraft:display_name": "a.b.c.d", which was not shown by scripting.
Reproduction
This example is taken from the behavior pack in the following world attached for convenience:
This world can be opened (in Minecraft Preview) for inspection or unzipped to access the code associated with such. Interacting with the blocks will send messages like shown above.
Attachments
Comments 0
No comments.