Jump to content

Recommended Posts

Posted

Hey,

I was wondering (and couldn't find any info on it anywhere) how I could get the username of the player using the mod (thus, you, as a user of my mod) and get it into a String to use in display etc. Thanks a lot in advance :)

Posted
13 minutes ago, diesieben07 said:

There is no "one user". There are always potentially multiple player. Which one do you want? You can get the username of a player using EntityPlayer::getName or the display name using EntityPlayer::getDisplayName.

I want the displayName of 'yourself' as in the player having the mod installed. Completely client side visual mod, so while it should work on other servers, it should only get your own name in a String. The other players don't matter to this.

Posted
17 minutes ago, diesieben07 said:

On the client you can get the player playing the game using Minecraft::player.

But how do I put the Minecraft player name in a variable. I just want the name as a string. Could you show me some example code because I've never heard of your double colins.

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.