Posted November 10, 20159 yr Hey, I am working with some code that required the players name to be the same. I would like to be able to test the code where the player name does not change from "playerX", ex" player293, then recompile and your name is player143 or whatever. Just a quick question, only way I found around was to compile, run another client with updated mod pack and join a LAN server. It is a bit tedious... not really a fan. Is there any easy fix, apart from changing my code to not use the players name? .|\| E0 |\|. /\ Fr0
November 10, 20159 yr If that is a bother you can use the use program arguments in the debug configuration to specify a user account: --username=<minecraft username> --password=<minecraft password> Also, just curious as to why it is the player name specifically that you are concerned with. In general, if you want to track a player use getPersistentID() - the value will be the same for a player account even if they rename the character.
November 10, 20159 yr Author Thanks, just for testing some stuff. Where would I find the debug config? .|\| E0 |\|. /\ Fr0
November 11, 20159 yr Add the arguments to a Run Configuration in your IDE. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
November 11, 20159 yr You don't need to specify a password unless you want to use an actual account (which will require an internet connection!) - I typically just supply the --username argument so my name is consistent and I don't have to worry if I'm connected or not. @OreCruncher A typical use case for wanting a consistent name is testing custom tames or some such where the owner/player is stored by UUID while offline and needs it to be the same next time they log in. http://i.imgur.com/NdrFdld.png[/img]
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.