Jump to content

[1.8]Chat Codes on Servers


Trusak

Recommended Posts

Hey, currently I am making a mod that would replace my own messages and I have a problem: My code only works in SinglePlayer. I tried all possible ChatCodes and none of them works.

Code:

@SubscribeEvent
public void Send(ServerChatEvent event){
	String message = event.message;
	if(message.contains(EnumChatFormatting.WHITE + "lol")){
		event.setCanceled(true);
		message = message.replace("lol", "*");
		Minecraft.getMinecraft().thePlayer.sendChatMessage(message);
	}

I have also tried stuff like

EnumChatFormatting.getTextWithoutFormattingCodes

or

EnumChatFormatting.RESET

Nothing is working :(

Thanks for help already! :D

Link to comment
Share on other sites

What do you mean your code only works in single player? And what is it you are EXACTLY trying to do?

Also, so you have a server proxy?

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

I want my messages to have words changed before they are sent. Here I want message "lol no" to be changed to "* no". When I type in "lol no" in SinglePlayer, it is changed to "* no" but when I type it in Multiplayer, nothing happens and "lol no" is being sent :(

Link to comment
Share on other sites

Do you have a ServerProxy?

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

ServerChatEvent... ClientSideOnlyClass reference...

 

Hmm.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

What? The server proxy?

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

ServerChatEvent... ClientSideOnlyClass reference...

 

Hmm.

 

Yes I know that, but it is always useful to have a ServerProxy anyway.

Also, if you keep wanting to get this to work, but are not trying anything suggested (cough, server proxy as I said in reply #1), you will never get anything done.

 

Look to what Draco said. ClientSideOnlyClass, ServerChatEvent.

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

Does that mean that you want me to put my code into my ServerProxy Class?

 

No, make a ServerProxy, and go for it. Also, look to what Draco said.

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

Your "server" proxy should be your common proxy that you already have.  There is no reason to have a dedicated "dedicated server" only class as 99.999% of the time you will want to do "servery stuff" on the client to during Single Player and LAN games.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

Announcements



×
×
  • Create New...

Important Information

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