Hi, i'm new at this universe of modding with Forge.
Recently while i'm working on my mod, i tried to implement a way to send a message from player when him breaks a block, and i was done by using the TextComponentString method, but now i'm trying to implement the same but adding color to the message.
I'm tried using Text Formatting, but i don't know if my code wasn't properly written or if this method is not compatible with TextComponentString.
public class ChatMessageSend {
@SubscribeEvent
public void sendMessage(BreakEvent event)
{
event.getPlayer().sendMessage(new TextComponentString("text").getStyle().setColor(TextFormatting.RED));
}
}
Any solution is appreciated.