Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jard

Members
  • Joined

  • Last visited

Everything posted by jard

  1. jard replied to jard's topic in Modder Support
    Thank you, I'll update and give it a shot!
  2. jard replied to jard's topic in Modder Support
    I'm using forge-1.8-11.14.4.1563-mdk, so I assume ITextComponent is IChatComponent, and wouldn't this be the event.message.getFormattedText(); ?
  3. jard replied to jard's topic in Modder Support
    I probably am retarded, but don't wanna be 'spoon fed' code. Could you maybe provide a example or direct me somewhere that could help me?
  4. jard posted a topic in Modder Support
    Hi, I'm making a simple forge mod to highlight words, everything works splendidly but I'm unsure of how to keep chat formatting intact. For instance lets say I was on a faction server , players have a faction, a rank and then their name and chat message. With being Highlighted what It looks like: [Faction] [Tag] Name: Sentence with the highlighted word you chose. (purple = white but if it was white you wouldn't be able to see it :P) With being Highlighted what I want it to look like: [Faction] [Tag] Name: Sentence with the highlighted word you chose. Here is my ClientChatReceivedEvent class: public class OnClientChatReceivedEvent { List<String> words = Highlight.getWords(); @SubscribeEvent public void onClientChatReceivedEvent(ClientChatReceivedEvent event) { String message = event.message.getFormattedText(); boolean sendOriginal = true; String newMessage = ""; // get the words String[] messageWords = message.split(" "); for (int w = 0; w < messageWords.length; w++) { // does this message word match any of the search words boolean wordMatches = false; for (int i = 0; i < words.size(); i++) { if (messageWords[w].equalsIgnoreCase(words.get(i))) { sendOriginal = false; wordMatches = true; newMessage = newMessage + EnumChatFormatting.RED + messageWords[w] + EnumChatFormatting.RESET + " "; break; } } if (!wordMatches) { newMessage = newMessage + messageWords[w] + " "; } } if (sendOriginal) { event.setCanceled(false); } else { event.setCanceled(true); Minecraft.getMinecraft().thePlayer .addChatMessage(new ChatComponentText(newMessage.trim())); System.out.println(message); } } } Is there a better way than to replace the entire chat message? Thanks! PS: i'm not too experienced in java/forge modding and im still learning ;P.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.