pyCraft icon indicating copy to clipboard operation
pyCraft copied to clipboard

Getting username and server ip

Open Code-Derek opened this issue 5 years ago • 1 comments

I want to get my username/uuid can display it in the top of the cmd window is there a variable for that? I am using auth_token.username right now but I would like it to show my in game name. Also can I get the ip of the server I am on?

Code-Derek avatar Jun 02 '20 15:06 Code-Derek

Assuming you use start.py:

How to get the IP: serverIP = options.address + ":" + str(options.port)

How to get the username: username = auth_token.profile.name

I hope this helps

MLG-fun avatar Jun 23 '20 15:06 MLG-fun