KyoriPowered / adventure

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

text-minimessage: Add a TagResolver for boolean values #857

Closed Joo200 closed 1 year ago

Joo200 commented 1 year ago

This will add a new TagResolver for boolean values.

Instead of passing number values or timestamps you want to display some text when a condition is met.

E.g. the text The issuer is a player for players and The issuer is a console for consoles. Currently that's not easily possible.

With the new tag you can use:

MiniMessage.miniMessage().deserialize("The issuer is a <isplayer:player:console>.", 
    Formatter.booleanChoice("isPlayer", isPlayer)
);