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

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?

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 ?

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

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

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.

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

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.