Posted December 9, 20168 yr 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!
December 9, 20168 yr 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.
December 9, 20168 yr Author 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
December 9, 20168 yr 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.
December 9, 20168 yr 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.
December 9, 20168 yr 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.
December 9, 20168 yr Author Yes, but you know that I only want it to be for me and to work on all servers?
December 9, 20168 yr 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.
December 9, 20168 yr Author Does that mean that you want me to put my code into my ServerProxy Class?
December 9, 20168 yr 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.
December 9, 20168 yr 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.
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.