Posted October 24, 20159 yr I made a mod (for personal use) that is supposed to create a notification when someone says something in a chat. This is my code: ChatNotifier.java: package com.notifier.chatnotifier; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = ChatNotifier.MODID, version = ChatNotifier.VERSION) public class ChatNotifier { public static final String MODID = "Chat Notifier"; public static final String VERSION = "1.0"; ChatEventHandler handler = new ChatEventHandler(); @EventHandler public void preinit(FMLPreInitializationEvent event) { FMLCommonHandler.instance().bus().register(handler); MinecraftForge.EVENT_BUS.register(handler); } } ChatEventHandler.java: package com.notifier.chatnotifier; import java.io.IOException; import net.minecraftforge.event.ServerChatEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ChatEventHandler { @SubscribeEvent public void checkNormalChat(ServerChatEvent event) { try { Runtime.getRuntime().exec("notify-send " + event.username + " \"" + event.message + "\""); //Creates a notification (Linux only) } catch (IOException e) { e.printStackTrace(); } } } The mod works perfectly in singleplayer, but obviously the point of the mod is to create notifications in multiplayer. I've tested it on a completely vanilla server, and also in a craftbukkit server, and neither work.
October 24, 20159 yr I have a work in progress mod that looks very similar to the one your creating (it has the exact same name) so I'm just wondering were abouts you got the idea for it? I posted a Alpha version of my mod a few weeks back, information is available on http://www.xelitexirish.com/chat-notifier/ View my website at -> http://www.xelitexirish.com/ You can nearly always contact me on my twitter (XeliteXirish)
October 24, 20159 yr Author I got the idea for it when I had Minecraft minimized and people wanted me, but I didn't know because I couldn't see it. After that I decided to make a simple mod for myself that sends a notification whenever someone says something in chat. The reason I called it chat notifier was because it did exactly that, notify me of chat. Your mod seems a little different to mine though because mine will send notifications (using system commands) when there is any message at all (which I plan on changing)
October 24, 20159 yr That sounds good, I'd like to chat to you about a few things, is this your twitter? https://twitter.com/Orfby/ If so could you follow me back and il send you a message? View my website at -> http://www.xelitexirish.com/ You can nearly always contact me on my twitter (XeliteXirish)
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.