Documentation
player
An online player.
Also has everything from offline_player, sender, entity, living.
Properties 26
Display name.
Food level, 0 to 20.
Experience level.
survival, creative, adventure or spectator.
Whether the player is flying.
Whether the player may fly.
Whether the player is sneaking.
Whether the player is a server operator.
Latency in milliseconds.
IP address.
Client language, such as en_us.
False once the player has left.
Hidden food reserve that is used up before the food bar.
Walking speed; 0.2 is normal, 1 is the maximum.
Flying speed; 0.1 is normal, 1 is the maximum.
All experience points the player has collected.
Client the player uses (vanilla, fabric...), if it said so.
Where the player respawns (bed or anchor), or none.
Where the player's compass points.
Progress to the next level, 0 to 1.
Name shown in the player list.
The player's inventory.
Item in the main hand (none if empty).
Username.
Unique id.
The backend server the player is on, or none.
Methods 17
Kicks the player.
Gives an item (an item value or a type name such as "diamond").
Shows a message above the hotbar.
Shows a big title.
Plays a sound, e.g. "entity.player.levelup".
Makes the player run a command (without the slash).
Opens an inventory or a menu for the player.
Closes whatever inventory the player has open.
Gives a potion effect, e.g. player.effect("speed", 30 seconds, 2).
True if the player has that potion effect.
Removes one potion effect, or all of them.
Removes the title from the player's screen.
Makes this player invisible to another player (vanish).
Makes this player visible to another player again.
True if this player can see the other player.
Greys out an item type in the hotbar for a while, like ender pearls.
Sends the player to a backend server (a server or its name).