Jump to content

[1.7.10] Changing a simple chat message not so simple...


Nique84

Recommended Posts

So, i thought, lets do this. I know how to program but i aint a pro. Lets start with something simple: Remove or change that simple message when the user logs in on the server.

I'm talking about the "User joined the game" and "User left the game" message. Not that 'client side' MOTD message you get when u logon a server. I mean that message that is being broadcasted serverwide to all players. I want to customize that but it seems that the function responsible for that is the initializeConnectionToPlayer() function from the ServerConfigurationManager class. In version (MC 1.7.10) line 157 to 169 to be exactly. It prepares the chatcomponentTranslation and then sends it.

 

In the beginning i stumbled upon those forge events and i instantly started looking up the reference for player login events. With no luck. I read about the ability of cancellation of events so that was really disappointing.  So, my question is.. are we able to remove that message and replace it by my own? And i mean that one on line 169?

 

this.sendChatMsg(chatcomponenttranslation);

 

I just want to be pointed in the right direction. I noticed it is part of an abstract class.

 

Thanks!

 

Link to comment
Share on other sites

Aha, thanks.

 

So basically what your solution does is catching and modifying the (from the server received) message on the client? (correct me if i'm wrong, i'm trying to understand the concept here).

Am i forced to ship my mod to every client then? (I want the mod to be on the server only. Not really a client mod, but if there is no other way..).

 

Edit:

Oh wait a minute. I see ServerChatEvent too. Let's figure that out. Maybe i can catch it before it is even send to the clients. (that would be ideally)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.