Jump to content

Main menu event and getting uuid


ssttevee

Recommended Posts

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

Link to comment
Share on other sites

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());
        }
    }

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.