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 created a block with it's own GUI. What the GUI dose is that creates an explosion based on number you input in the text box. Everything works on singleplayer, but on multiplayer, the server crashes when i click on the button

 

Here's the method

 

protected void actionPerformed(GuiButton button) {

 

World world = null;

WorldServer[] list = MinecraftServer.getServer().worldServers; // in console it says this line crashes

 

for (WorldServer ins : list) {

if (ins.provider.dimensionId == entity.worldObj.provider.dimensionId)

world = ins;

}

if (world == null)

world = list[0];

 

if (button.id == 0) {

 

if (true) {

if (power.getText().isEmpty())

power.setText("");

else if (power.getText().matches("[a-zA-Z]+"))

power.setText("");

else if (power.getText().matches("[0-9]+")) {

this.mc.displayGuiScreen((GuiScreen) null);

world.createExplosion((Entity) null, i, j - 10, k, Integer.parseInt(power.getText().trim()), true);

}

else

power.setText("");

}

 

}

 

}

 

 

_         

___ ___| |__  _ __ 

/ __/ __| '_ \| '_ \

\__ \__ \ | | | | | |

|___/___/_| |_|_| |_|

  • Author

How can I do that? I never mess around with packets before, I heard, but don't know what it is.

_         

___ ___| |__  _ __ 

/ __/ __| '_ \| '_ \

\__ \__ \ | | | | | |

|___/___/_| |_|_| |_|

  • Author

Alright. Thank you for leading me on what is causing the problem :)

_         

___ ___| |__  _ __ 

/ __/ __| '_ \| '_ \

\__ \__ \ | | | | | |

|___/___/_| |_|_| |_|

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.