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.

Featured Replies

Posted

I setup my SimpleNetworkWrapper in my preInit method of my base mode class. This works fine for dedicated servers and single player, but when my mods runs as a client in multiplayer, it crashes. How can I prevent my mod from setting up the SimpleNetworkWrapper when it is run as a client on multiplayer. I already tried

Minecraft.getMinecraft.isSinglePlayer()

to detect if my mod is running on an integrated server, but it always returns false.

  • Author

I fixed the issue for single player by making a global variable that the integrated server can set directly, nullifying the need for packets. Now my SimpleNetworkWrapper isn't working on multiplayer. I set it up in my server's preInit method with

net = NetworkRegistry.INSTANCE.newSimpleChannel("dataChannel");
net.registerMessage(PacketHandler.class, Packet.class, 0, Side.CLIENT);

and send it with

net.sendTo(new Packet(data), player);

I tested this code on single player without the global variable and it worked, but on multiplayer the client doesn't receive the packet.

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...

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.