mojira.dev
MC-310486

NBT Text Component Does Not Render In Tooltip

Tooltip and name for items fail to render NBT text components.

Example with /give

Execute as player:

/give @s stick[ item_name=[ { "type":"nbt", "entity":"@s", "nbt":"Health" } ]]

Expected Result In Lore:

20

Actual Result In Lore:

Example with /item

Execute as player:

/item modify entity @s weapon.mainhand {"function":"minecraft:set_components","components":{"minecraft:lore":[{"text":"Health:","type":"text"},{"entity":"this","nbt":"Health","type":"nbt","interpret":true}]},"conditions":[]}

Expected Result In Lore:

Health: 20

Actual Result In Lore:

Health: 

Environment

Windows 11 pro

Linked issues

Comments 1

You can do this with the set_name item modifier 🙂

Water Bear

(Unassigned)

Unconfirmed

26.3 Snapshot 5

Retrieved