mojira.dev
MC-278190

potion_contents' custom_name is inconsistent with other user-facing strings (making certain names impossible that would be possible without potion contents)

The bug

All user-facing strings are JSON text components, except custom_name in the potion_contents data component. This makes it impossible to give text formatting, colors, and use other text types than the hardcoded

{"translate":"item.<namespace>.<id>.effect.<value>"}

without using the custom_name data component. Using that has side effects like being able to be removed in anvils, and showing in item frames.

Effects

It's impossible to give a potion which grants effects with a custom name that cannot be removed in an anvil, nor shows in a map, that is:

  • formatted

  • colored

  • different text types (text, keybind) (including resolved JSON text components of nbt, selector and score)

  • a translation string of a different origin (such as using item.minecraft.stick)

The effects can also be resolved by making item_name used if neither custom_name nor potion are set, but that would not resolve the inconsistency of custom_name.

Comments 3

Please outline a clear way to confirm and reproduce this issue, with any necessary commands or observation steps.

/give @s potion[potion_contents={custom_name:"test",custom_effects:[{id:strength,duration:20}]}]
/give @s potion[potion_contents={custom_effects:[{id:strength,duration:20}]},item_name='"test"']

First command results in an item named "item.minecraft.potion.effect.test", second one "Uncraftable Potion"; the only way to name a potion with effects "test" is this:

/give @s potion[potion_contents={custom_effects:[{id:strength,duration:20}]},custom_name='{"text":"test","italics":false}']

But that name can be removed by an anvil, and shows in item frames.

These commands highlight the inability to change text type, but you also can't give formatting nor color.

Thank you for your report!
After consideration, the issue is being closed as Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Dhranios

(Unassigned)

Confirmed

Text

1.21.3, 24w45a, 24w46a

Retrieved