KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
678 stars 103 forks source link

Default value for unresolved tags #1064

Open Galapen opened 2 months ago

Galapen commented 2 months ago

Similar to Apache Common's StringSubstitutor, it would be helpful to be able to define text that should be placed if a tag/placeholder doesn't exist.

StringSubstitutor uses the following syntax ${myVar:-Unknown} where "Unknown" would be substituted if myVar is unresolved. A similar syntax could be introduced into MiniMessage e.g. <fallback:other-tag:fallback-text:args-other>.