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.

yazigegeda

Members
  • Joined

  • Last visited

Everything posted by yazigegeda

  1. As shown: I need to use forge to create a button click event When the "start Lan World" button is pressed, the task I wrote will be executed. Can you tell me what this event is called? help me! !
  2. package com.example.examplemod; import java.io.File; import java.io.IOException; import net.minecraft.client.Minecraft; import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.server.management.PlayerList; import net.minecraft.util.HttpUtil; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraft.server.MinecraftServer; import net.minecraft.server.gui.MinecraftServerGui; import net.minecraftforge.fml.relauncher.ReflectionHelper; import java.lang.reflect.Field; import org.apache.logging.log4j.Logger; @Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION,serverSideOnly = true,acceptableRemoteVersions="*") public class ExampleMod{ public static final String MODID = "hello"; public static final String NAME = "hello Mod"; public static final String VERSION = "1.0"; public Logger logger; @SuppressWarnings("deprecation") @EventHandler public void Onjoin(FMLServerStartingEvent event) { MinecraftServer e=event.getServer(); IntegratedServer online = (IntegratedServer) e.getServer(); online.setOnlineMode(false); Field maxPlayer = ReflectionHelper.findField(PlayerList.class,"maxPlayers","field_72405_c"); try { maxPlayer.set(online.getPlayerList(),20); } catch (IllegalAccessException e1) { e1.printStackTrace(); } server.properties: online-mode = false and max-players have been completed, how to implement server-port and resource-pack next? help me!

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.