Posted March 21, 20178 yr I'm trying get the player World name I tryied to use: World world = Minecraft.getMinecraft().thePlayer.getEntityWorld(); world.getSaveHandler().loadWorldInfo().getWorldName() But It crash the Minecraft. Have another method to get the world name?
March 21, 20178 yr Author The full code: @SubscribeEvent public void onPlayerAFK(TickEvent event) { if (Minecraft.getMinecraft().thePlayer != null) { World world = Minecraft.getMinecraft().thePlayer.getEntityWorld(); ChatUtil.sendMessage("World name: " + world.getSaveHandler().loadWorldInfo().getWorldName()); } } I'm using "TickEvent" to check
March 21, 20178 yr Author Oh, Yeah. I'll change this event to: "EntityJoinWorldEvent". I forget to change it. @diesieben07 But I can't get the world name? Edited March 21, 20178 yr by SkyVox
March 22, 20178 yr Author Hm, I tried to get the world name, But always when send the message to me the world name is: "MpServer" equals you said. I don't know how to obtain the WorldInfo instance
March 22, 20178 yr 3 minutes ago, SkyVox said: Hm, I tried to get the world name, But always when send the message to me the world name is: "MpServer" equals you said. I don't know how to obtain the WorldInfo instance 21 hours ago, diesieben07 said: the client doesn't know the world's name (it will always be "MpServer").
March 22, 20178 yr Author So, I don't know the World name? But I can't get like an ID to know the World or something?
March 22, 20178 yr You could get the name using a packet... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
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.