pyCraft
pyCraft copied to clipboard
Getting username and server ip
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?
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