Posted March 2, 20178 yr Hi guys. Is it possible to place some strings in chat input? Like it does by clicking on some messages created by using json, but how can i do the same, clicking on some mob, player or something else? Would be nice, it there is way to do this on server side, but if someone knows how to do this on client side, it would be good too. Edited March 3, 20178 yr by CeperaProduction Solution was found
March 3, 20178 yr Author On 3/2/2017 at 8:06 PM, diesieben07 said: You can send chat to a specific player by using EntityPlayer::sendMessage. You can send chat to everyone on the server using PlayerList::sendMessage. I know this, but this is not what i need. I wanna do something like printing /msg <player> in chat input when one player clicks on anotherone
March 3, 20178 yr On 3/3/2017 at 9:51 AM, CeperaProduction said: I know this, but this is not what i need. I wanna do something like printing /msg <player> in chat input when one player clicks on anotherone Create an instance of GuiChat using the GuiChat(String) constructor, which populates the text box with the specified string; then display it with Minecraft#displayGuiScreen. There's no existing server-to-client packet that does this, so you'll need to create your own. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 3, 20178 yr If the chat GUI is already open, you can add text to it by calling GuiTextField#writeText on GuiChat#inputField. The field is protected, so you'll need to access it via reflection. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 3, 20178 yr Author On 3/3/2017 at 10:07 AM, Choonster said: Create an instance of GuiChat using the GuiChat(String) constructor, which populates the text box with the specified string; then display it with Minecraft#displayGuiScreen. There's no existing server-to-client packet that does this, so you'll need to create your own. Thanks, it's right what i need.
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.