-
-
Notifications
You must be signed in to change notification settings - Fork 8
Need a little help with a mod idea... (client-side commands) #14
Comments
Currently there is only one dirty way of achieving what you want. If you want to display a custom message on the client-side chat, you can iterate over ClientListener interface instances returned by MinecraftClient's getClientListeners() method and invoke their messageReceived() method. Said method takes two arguments, first is a non-JSON chat message, which can be colored with "§" symbols. Second argument is ServerChatMessagePacket.Position enum, This enum has following values: CHAT, SYSTEM and HOTBAR and it tells the client where the received message should be displayed. Both CHAT and SYSTEM messages will be displayed in main chat box, while HOTBAR messages will be displayed in the small box on top of client window. |
Thanks for the explanation! I will try to get it working using the “dirty” way first. But some “official” interfaces might be a good idea for the next version, especially if there are maybe other developers too in the future who perhaps might want to interact with the chat messages too. |
Did you already add that? It would be nice to have something like an “official” API for this, so I don't have to “rebuild” everything in the “dirty” way in each version. |
@BigPanda97 By the way, out of curiosity, may I ask what kind of mod are you going to make? |
Perfect, thanks!
I'm playing around with several ideas I had in the past, but one of them would be something like this to make the private messages (/msg) more secure. ^^ |
Hello @BigPanda97! |
Hello @Defective4! Thanks, that's really really nice. I have some exams in the upcoming weeks, so it will take some time until I can test everything, but it is really cool that you started the developing of this awesome tool again! |
No problem! |
I'm currently trying to make some kind of mod/plugin for this chat client.
However, I need to be able to make some kind of command handler for client-side commands.
(For example: “/mod” etc.)
As far as I know, this chat client does not have something like client-side commands yet, so I have to do it on my own.
But therefore, I need to be able to do two things:
So basically, into which methods of the code would I have to “hook” to be able to implement such a feature?
The text was updated successfully, but these errors were encountered: