|
| void | sendMessage (const wstring &message, int type=0, int customData=-1, const wstring &additionalMessage=L"") |
| | Send a chat message directly to this player's screen.
|
|
void | disconnect () |
| | Kick this player from the server. Calls disconnect() and closes the connection.
|
| virtual void | teleportTo (double x, double y, double z) override |
| | Teleport this player to a world position.
|
| virtual bool | hurt (DamageSource *source, float dmg) override |
| | Apply damage to this player from a damage source.
|
| bool | canHarmPlayer (shared_ptr< Player > target) |
| | Check if this player can harm another player (PvP check).
|
| virtual void | giveExperienceLevels (int amount) override |
| | Give XP levels to this player.
|
| virtual void | changeDimension (int i) override |
| | Change which dimension this player is in.
|
| void | setGameMode (GameType *mode) |
| | Set the game mode for this player.
|
| ServerLevel * | getLevel () |
| | Get the ServerLevel this player is currently in.
|
| bool | hasPermission (class EGameCommand command) |
| | Check if this player has a server-side permission.
|
|
void | resetLastActionTime () |
| | Reset this player's last-action timer (anti-idle).
|
| float | getHealth () const |
| | Get the player's current health.
|
| void | setHealth (float health) |
| | Set the player's health directly.
|
| float | getMaxHealth () const |
| | Get the player's maximum health.
|
| bool | hurt (DamageSource *source, float amount) |
| | Apply damage from a damage source.
|
| void | heal (float amount) |
| | Heal the player by a given amount.
|
| int | getFoodLevel () const |
| | Get the player's current food level.
|
| int | getExperienceLevel () const |
| | Get the player's experience level.
|
| void | giveExperienceLevels (int amount) |
| | Give experience levels to the player.
|
| wstring | getName () const |
| | Get the player's username.
|
| bool | isSneaking () const |
| | Check if the player is currently sneaking.
|
| bool | isSprinting () const |
| | Check if the player is currently sprinting.
|
| bool | isFlying () const |
| | Check if the player is flying.
|
| void | setFlying (bool flying) |
| | Set the player's flying state.
|
|
double | getX () const |
| | Get the player's current X position.
|
|
double | getY () const |
| | Get the player's current Y position (feet level).
|
|
double | getZ () const |
| | Get the player's current Z position.
|
| void | teleportTo (double x, double y, double z) |
| | Teleport the player to a world position.
|
| virtual shared_ptr< ItemInstance > | getCarriedItem () |
| | Get the item currently held in the player's hand.
|
| class Inventory * | getInventory () |
| | Add an item to the player's inventory.
|
|
virtual void | respawn () |
| | Trigger the player's respawn.
|
|
void | kill () |
| | Kill the player immediately. Triggers death screen.
|
| virtual void | playSound (int soundId, float volume, float pitch) |
| | Play a sound effect at the player's position.
|
| bool | hasPermission (class EGameCommand command) |
| | Check whether this player has a given game permission.
|
Server-side representation of a connected player.
Contains the player's server game mode, connection, and chunk state. Access via SDK::GetPlayerList()->players or PlayerList::getPlayer().
Definition at line 757 of file SDK.h.