#✅ | Current player health + colored text

1 messages · Page 1 of 1 (latest)

empty marlin
#

how do i make the player health digits have colored text
|||
{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}/{"placeholder":"math_round","values":{"num":"{"placeholder":"max_player_health"}","decimals":"1"}}
|||

vague tapirBOT
# empty marlin how do i make the player health digits have colored text ||| {"placeholder":"ma...

Use Minecraft text formatting around the numbers in a Text element, or use a Single-Line Text element if you want JSON components. 🙂

For your example, the easiest way is to color the whole line with & codes:

&c{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}&7/&c{"placeholder":"math_round","values":{"num":"{"placeholder":"max_player_health"}","decimals":"1"}}

But: if this is a Text element, formatting codes can be a bit limited. The docs say Text elements use Markdown, while raw Minecraft text components are for button/slider labels. If you want proper colored text in a HUD text element, use Markdown/style in the element instead.

Also, your placeholder nesting is a bit off:

  • math_round uses num
  • if you want 1 decimal, use decimals:"1"

Correct version:

{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}/{"placeholder":"math_round","values":{"num":"{"placeholder":"max_player_health"}","decimals":"1"}}

If you want, I can rewrite it into a version that shows:

  • current health in red
  • slash in gray
  • max health in white ✨
empty marlin
#

i want custom color

vague tapirBOT
# empty marlin i want custom color

Yep — for custom colors, use a Text element and wrap the numbers with the FancyMenu color code format:

%#ff5555%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}%#%

If you want the whole current/max display in your own color, do this:

%#ff5555%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}/%#77fc03%{"placeholder":"math_round","values":{"num":"{"placeholder":"max_player_health"}","decimals":"1"}}%#%

If you want:

  • current health = one color
  • max health = another color
  • slash = another color

I can format it for you exactly 👀

empty marlin
#

why is this not coloring?
|||
%#ff5555%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_absorption_health"}","decimals":"1"}}%#%
|||

vague tapirBOT
# empty marlin why is this not coloring? ||| %#ff5555%{"placeholder":"math_round","values":{"nu...

Because Text elements don’t use those raw color wrappers like that. For Text elements, you should use Markdown styling or set the element’s text color in the right-click menu.

If you want the number itself to be a custom color, the clean way is:

  • Right-click the Text element
  • Set its text color to your hex color
  • Put only the placeholder in the text field

Example:

{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_absorption_health"}","decimals":"1"}}

If you need different colors for different parts like HP and max HP, split them into separate Text elements.

Also note: current_player_absorption_health is a number placeholder, so the rounding is fine — the color wrapping is the part that won’t work there.

If you want, I can help you set it up as 2–3 separate text elements with custom colors ✨

empty marlin
#

but this worked?

|||
%#ff0606%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}/{"placeholder":"math_round","values":{"num":"{"placeholder":"max_player_health"}","decimals":"1"}}%#%
|||****

vague tapirBOT
# empty marlin but this worked? ||| %#ff0606%{"placeholder":"math_round","values":{"num":"{"pl...

Ahh, then the issue is the closing %#% placement.

In your working example, the color wrapper surrounds the whole text, so it colors everything until the end:

%#ff0606%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}/{"placeholder":"math_round","values":{"num":"{"placeholder":"max_player_health"}","decimals":"1"}}%#%

Your non-working one only wrapped the first number, and the formatting likely got broken by the nested placeholder structure.

So if you want just the absorption number colored, use the same pattern and keep the wrapper around the exact text you want colored:

%#ff5555%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_absorption_health"}","decimals":"1"}}%#%

If that still doesn’t work, try putting it in a single-line text element instead of a normal Text element. That’s usually the safest for placeholder-heavy formatted text.

If you want, I can give you a clean full example for:

  • health
  • absorption
  • max health
    with separate colors 🙂
empty marlin
#

this still did not fix it

vague tapirBOT
# empty marlin this still did not fix it

Then I’d need a bit more context to help properly.

Please tell me:

  • Which element type you’re using: Text or Single-Line Text
  • Where you pasted it: the element text field, label field, etc.
  • Whether you want the color to apply to:
    • the whole health display
    • only the current health number
    • only the slash/max health

From the docs:

  • Text elements use Markdown
  • Single-Line Text supports Minecraft raw text components
  • color wrappers like %#...% only work in the right text context

If you want, paste the exact element type + full text field content and I’ll tell you the correct format 🙂

empty marlin
#

its just text displaying the absorption health digits

vague tapirBOT
# empty marlin its just text displaying the absorption health digits

Got it — if it’s a Text element, then use a plain Markdown color wrapper around the whole line, or set the element’s color in the right-click menu.

For just the digits, try this:

%#ff5555%{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_absorption_health"}","decimals":"1"}}%#%

If that still shows no color, then the Text element is probably not parsing that color syntax in your setup, and you should instead:

  • right-click the Text element
  • set its text color to the hex color you want
  • keep only the placeholder as the text

Like:

{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_absorption_health"}","decimals":"1"}}

So: for Text elements, the reliable way is the element’s own color setting, not inline color tags.

If you want, I can show you the exact setup for colored health digits + custom slash + max health using separate text elements 🙂

#
Thread Marked as Solved

This support thread has been marked as solved by @empty marlin.

The AI helper is now disabled, but you can still continue the conversation if needed. Thank you for using our support system!