September 6, 201411 yr There would be no EntityPlayer instance, but if it is a client thing, I'm sure Minecraft instance would have currentScreen set to GuiMainMenu. If you want to know when a player leaves in multiplayer, you can use PlayerEvent.PlayerLoggedOutEvent.
September 7, 201411 yr Author There would be no EntityPlayer instance, but if it is a client thing, I'm sure Minecraft instance would have currentScreen set to GuiMainMenu. If you want to know when a player leaves in multiplayer, you can use PlayerEvent.PlayerLoggedOutEvent. I have music playing from within java, not from within minecraft. So i want that music to stop when I leave the game
September 7, 201411 yr Create a new thread when your mod is loading (init function for example) You can code a thing like this (sry i can't try it now): void run() //Make a thread that run as long as the player didn't join the GuiMainMenu or exit the game { while (Minecraft.getMinecraft() != null && !(Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu)) { try { Thread.sleep(100); } catch (Exception e) { } } if (Minecraft.getMinecraft() != null) (new My_Shound()).play; } That's kinda hardcodded but i can't see any other way
September 7, 201411 yr @diesieben07 i'm sorry but i think you didn't understand what DannieXD asked, he would like to know if the current game screen is the main menu, SoundEvents have nothing to do with this And i think (i didn't verify every events yet), that there's no event which are called as long as the user didn't join a world EDIT: That's why i'm purposing this hardcodded solution (I hope my english wasn't too bad ^^" )
September 7, 201411 yr Again i'm sorry, but that's not what he asked I want an if statment that checks if the player is on the main menu So if you have any other better way to get if the player is on the main menu (GuiMainMenu), tell me and i'd be really happy cause i'm also doing this check
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.