mojira.dev
MCPE-235802

Block#localizationKey property in scripting does not respect display name component

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:

Vanilla Block Demo.png

The following shows (correct) localization of a custom block without the display name component:

Custom Block without Display Name Demo.png

Finally, here is (incorrect) localization information for a custom block with the display name component:

Custom Block with Display Name Demo.png

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:

[media]

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.

Ciosciaa

(Unassigned)

Unconfirmed

Multiple

26.10.21 Preview

Retrieved