-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The Problem
In Minecraft 1.21.5 entity text components are replaced with an empty string when an entity's data is merged/modified in any way. This is due to changes to the text component format in Minecraft 1.21.5.
Snippet from Text component format/Before Java Edition 1.21.5 - Minecraft Wiki:
Before Java Edition 1.21.5, the text component format was very different. The biggest difference is that text components were represented exclusively in JSON and saved as strings containing JSON, rather than being represented as SNBT and saved as NBT objects.
For example, instead of {text: "Hello World", color: "red"}, you would write {"text": "Hello World", "color": "red"} or '{"text":"Hello World","color":"red"}' depending on the context.
Example / Steps To Reproduce
- Load up Minecraft 1.21.5 with the Client Data Command mod installed, and create a new world with commands enabled.
- Summon a Text Display entity with a text component.
Example:/summon text_display ^ ^2 ^5 {billboard:"vertical",transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[4f,4f,4f]},text:{"bold":true,"color":"gold","text":"Hello World!"}} - Get the client-side data of the Text Display entity. The text component should be present.
Example:/datac get entity @e[type=minecraft:text_display,limit=1,sort=nearest] - Merge/Modify the client-side data of the Text Display entity in any way.
Example:/datac merge entity @e[type=minecraft:text_display,limit=1,sort=nearest] {transformation:{scale:[8.0f,8.0f,8.0f]}} - Get the client-side data of the Text Display entity. The text component will have been replaced by an empty string.
Example:/datac get entity @e[type=minecraft:text_display,limit=1,sort=nearest] - (Bonus) Trying to specifically get the text component will now crash your game:
Example:/datac get entity @e[type=minecraft:text_display,limit=1,sort=nearest] text
Metadata
Metadata
Assignees
Labels
No labels