Hello,
I load String in a file, like this one :
§aHello §e{player}§a !
That I transform to a TextTemplate with this method :
private static TextTemplate messageToTextTemplate(String message) {
String[] splitArg = message.split("(?=\\{)|(?<=})");
Object[] template = new Object[splitArg.length];
for(int i = 0; i < splitArg.length; i++) {
String str = splitArg[i];
if(str.startsWith("{") && str.endsWith("}"))
template[i] = TextTemplate.arg(str.substring(1, str.length()-1)).build();
else
template[i] = str;
}
return TextTemplate.of(template);
}
I apply arguments and I get the Text.
If I send this Text to the player, the hover I added for some arguments (like player
above) is present, but the color does not apply for the arguments :
My mouse is on “CanardNocturne”
If I send the same Text but by doing toPlain()
, the color is good but the hover disappears :
My mouse is on “CanardNocturne”
How can I do it ?