Hello, im trying to make it so if the message that is sent in chat is == `hi` it will send hi! back.
This is what I have managed so far, although im unsure how i can make it only send if the message is == `hi` Originally I tried if(e.message.equals("hi");
However, it is false no matter what I do!
The type is IChatComponent
I then found out that I can do the following:
However, im unsure how i can filter the message so its only true if the message is == `hi`
@SubscribeEvent
public void onChat(ChatReceivedEvent e) {
if(e.message.equals(e.message)) {
System.out.println(e.message);
mc.Player.sendChatMessage("hi!");
}else {
System.out.println(e.type);
System.out.println("1");
}
}
If anyone could help me it would be great as I have been trying to get this to work for around 2 hours.
Thanks,
Logan