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.

Orfby

Members
  • Joined

  • Last visited

  1. But that wouldn't be client-side would it? I'd like it to just affect the person with the mod, so it works on all servers
  2. Say for whatever reason I want to play a cat sound effect just to the client, how would I do that? I've seen PositionedSoundRecord var13 = new PositionedSoundRecord(new ResourceLocation("name"), 1, 1, x, y, z); in other projects, but I don't know what the name is for a cat sound and I'd also like it to not be based off of position.
  3. 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)
  4. What event could I use for new messages in the client?
  5. 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.

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.