Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted
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").

 

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.