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.

mlgmxyysd

Members
  • Joined

  • Last visited

  1. If offline-mode server is not allowed, it is unable to set online-mode=false in server.prop.
  2. Why? I WANT to do that. Is that about you?
  3. Yes, it is necessary to use unofficial login system in offline-mode server.
  4. And ClientTickEvent, PlayedLoggedInEvent dont have sendChatMessage() method.
  5. OKAY, I does not use /login command, replace /login to /exp ok? IS THIS OK? package org.meowcat.autocommadner; import net.minecraft.client.Minecraft; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.io.*; import java.lang.reflect.Method; import java.util.Properties; public class JoinEvent { private Properties prop = new Properties(); JoinEvent() { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); } @SideOnly(Side.CLIENT) @SubscribeEvent public void PlayerJoinGame(TickEvent.ClientTickEvent event) throws IOException { try{ Class mc = Class.forName(Minecraft.class.getName()); Method[] methods = mc.getMethods(); for (Method method : methods){ Main.logger.info(method.getName()); } } catch (ClassNotFoundException e ) { e.printStackTrace(); } Minecraft.getMinecraft().player.sendChatMessage("/exp"); } }
  6. When player join a game (server/single), player will send a message(or command) automatically.
  7. Please don't get caught up in the secondary problem. I only want to solve NullPointerException.
  8. It may cause by network problem. package org.meowcat.autocommadner; import net.minecraft.client.Minecraft; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.io.*; import java.lang.reflect.Method; import java.util.Properties; public class JoinEvent { private Properties prop = new Properties(); JoinEvent() { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); } @SideOnly(Side.CLIENT) @SubscribeEvent public void PlayerJoinGame(TickEvent.ClientTickEvent event) throws IOException { try{ Class mc = Class.forName(Minecraft.class.getName()); Method[] methods = mc.getMethods(); for (Method method : methods){ Main.logger.info(method.getName()); } } catch (ClassNotFoundException e ) { e.printStackTrace(); } File file = new File("config/user.properties"); if (!file.exists()) { Minecraft.getMinecraft().shutdown(); } InputStream in = new BufferedInputStream(new FileInputStream("config/user.properties")); prop.load(in); String password = prop.getProperty("Password"); String registered = prop.getProperty("IsRegistered"); if (!registered.equals("true")) { Minecraft.getMinecraft().player.sendChatMessage("/register " + password + " " + password); } else { Minecraft.getMinecraft().player.sendChatMessage("/login " + password); } } } java.lang.NullPointerException: Unexpected error at org.meowcat.autocommadner.JoinEvent.PlayerJoinGame(JoinEvent.java:42) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_18_JoinEvent_PlayerJoinGame_ClientTickEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:344) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1708) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) These are codes & errors
  9. All code and error is posted at top.
  10. It not work. When game inited(not join a game),force close by NullPointer.
  11. The mod is a client mod,not a server mod.
  12. That is not main issue. I can replace by any command,it only is a placeholder.
  13. Auto send a command when player join game (server/single).

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.