Posted April 17, 20214 yr Hello I just started with java and minecraft modding. I want to implement a very simple task but unfortunately I do not know the right event for it. Messages sent via Minecraft.getMinecraft().player.sendChatMessage(message); from the client to the server I can use: public void onChat(ClientChatReceivedEvent event) to read it back in. However, there are now also messages that are sent via Minecraft.getMinecraft().player.sendMessage(m) only direct to the client. Is there also a possibility to read these messages? Another mod writes these "client only" messages that I want to respond to. Joe6pack
April 17, 20214 yr Author ok, then I will go on the search for example code and try if I can do it that way. Thank you very much
April 17, 20214 yr Author it's me again, somehow I can't get to the message even via the gui Minecraft.getMinecraft().player.sendChatMessage("erste Nachricht"); ITextComponent m = new TextComponentString("zweite Nachricht"); Minecraft.getMinecraft().player.sendMessage(m); Minecraft.getMinecraft().player.sendChatMessage("dritte Nachricht"); String msg = Minecraft.getMinecraft().ingameGUI.getChatGUI().getSentMessages().toString(); logger.info(msg); Output: [erste Nachricht, dritte Nachricht] what am i doing wrong?
April 17, 20214 yr Author ok i have to give up. i don't have the slightest idea how to use or read chatlines. All the search was unsuccessful. Can not you give me a little tip how the code must look like to access chatlines? I can handle the processing of the array Let's assume there is only one entry in the complete chat and I want to read this... please help me.
April 17, 20214 yr Author Ok, thanks for your help. You can close the topic. I think I need much more time with the basics of Java.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.