Or just use the status command in console and take a picture of that, or click on their name on the SB and use that.
Also I'm not sure if you made that code, but if you did It won't work because you are not passing the player to the function. Not to mention it will cause an error if you are looking at the world.
pastebin.com/1yyt2bY5