Posted June 22, 201510 yr Is there an event that runs when the main menu is started or after initialization completes where I can get the players uuid?? While I'm at it, how do I verify that the user is actually logged in though mojang?
June 22, 201510 yr There events fired after game initialization, but why do you need their UUID ? And why do you want to see if the players is logged in ?
June 22, 201510 yr The event you are looking for should be GuiOpendedEvent (or sth like that) there you should check if The opened gui is The Main Menu. Have in mind that The player comes back to The Main Menu when logging out of a game, so you should check if your player is already logged in that 3rd Party thingy
June 22, 201510 yr The name of the event is InitGuiEvent, but you can also use the postInitializationEvent
June 23, 201510 yr Author I am getting Time: 6/22/15 5:19 PM Description: Initializing game java.lang.NullPointerException: Initializing game at com.ssttevee.blockbank.EventHookContainer.onGuiOpen(EventHookContainer.java:27) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_EventHookContainer_onGuiOpen_GuiOpenEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:961) at net.minecraft.client.Minecraft.startGame(Minecraft.java:538) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.ssttevee.blockbank.EventHookContainer.onGuiOpen(EventHookContainer.java:27) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_EventHookContainer_onGuiOpen_GuiOpenEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:961) at net.minecraft.client.Minecraft.startGame(Minecraft.java:538) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) relevant code @SubscribeEvent public void onGuiOpen(GuiOpenEvent event) { if(event.gui instanceof GuiMainMenu) { System.out.println(Minecraft.getMinecraft().thePlayer.getGameProfile()); } }
June 23, 201510 yr Try replacing your System.out with a simple text string, like System.out.println("Hello!"); Then read in the console and see if you are on the client side or the server side.
June 23, 201510 yr Author I got it. If anyone needs it, it's: Minecraft.getMinecraft().getSession().getProfile()
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.