Text Component, mix of dynamic and static text #320

Open
opened 2026-08-22 17:05:40 +00:00 by DiscordBot · 0 comments
Owner

Problem and Suggestion

While dynamic text components exist; using Values in place of Minecraft's Text Component limits flexibility. What about combining static text with dynamic values using a format string with placeholders?

For example, a static string with placeholders that can be replaced by Values, simple code that could be represented in json:
"Hello, %s. You have obtained %s".replace(name_data_attachment, choice_string_data_attachment)

Implementation

I was thinking this can be written within the class TextComponentValueHolder:

  • Store placeholders: Add a separate variable, placeholders maybe? (Work out the name semantics later lmao)
  • Apply formatting: Handle the placeholder replacement logic directly within the get() method.

Finally, to expand usage beyond the ui widgets, it can replace the variable types in Power name, and AbilityProperties title


Reported by 🚨Spyeedy🚨 (@spyeedy) via Discord — open thread

### Problem and Suggestion While dynamic text components exist; using Values in place of Minecraft's Text Component limits flexibility. What about combining static text with dynamic values using a format string with placeholders? For example, a static string with placeholders that can be replaced by Values, simple code that could be represented in json: ```"Hello, %s. You have obtained %s".replace(name_data_attachment, choice_string_data_attachment)``` ### Implementation I was thinking this can be written within the class `TextComponentValueHolder`: * Store placeholders: Add a separate variable, `placeholders` maybe? (Work out the name semantics later lmao) * Apply formatting: Handle the placeholder replacement logic directly within the get() method. Finally, to expand usage beyond the ui widgets, it can replace the variable types in Power `name`, and AbilityProperties `title` --- <sub>Reported by 🚨Spyeedy🚨 (@spyeedy) via Discord — [open thread](https://discord.com/channels/116908382878695430/1540768936130510968)</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ThreeTAG/Palladium#320
No description provided.