# IPlayerEntity

| Methods        | Properties   |
| -------------- | ------------ |
| GetName        | EntityId     |
| GetUuid        | Position     |
| IsBot          | Rotation     |
| GetHealth      | Effects      |
| IsDead         | Equipment    |
| GetAge         | HasDespawned |
| IsCrouched     | HasMoved     |
| IsSwimming     |              |
| IsSprinting    |              |
| HasLineOfSight |              |
| Attack         |              |
| Interact       |              |
| LookAt         |              |
| LookAtSmooth   |              |
| MoveTo         |              |
| MoveToRange    |              |
| Follow         |              |

## Methods

### GetName

Returns the name of this player.

```csharp
string GetName();
```

###

### GetUuid

Returns the uuid of this player. You can use <https://mcuuid.net/> to convert a username to an uuid manually. The returned value is in the format of \`91a546fca6fe44c99550ab2291f28760\` (does not have dashes).

```csharp
string GetUuid();
```

###

### IsBot

Returns true if the given player is a bot, otherwise returns false. This function will only return accurate results if the bots are from your personal OQ.MineBot client (You will not be able to detect other people's bots).

```csharp
bool IsBot();
```

###

### GetHealth

Returns the health of this player.\
Note: the Health is measured 0 (aka dead) up to 20 (full health), not up to 10 like Minecraft's visual indicators.

```csharp
float GetHealth();
```

###

### IsDead

Returns whether this player is dead.

```csharp
bool IsDead();
```

###

### GetAge

Returns the number of ticks that this player has existed for. This starts counting up as soon as this player is sent to the bot by the server (time since render). Each tick in this case refers to a Minecraft tick, which is 50ms per tick.

```csharp
int GetAge();
```

###

### IsCrouched

Returns whether this player is crouched or not.

```csharp
bool IsCrouched();
```

###

### IsSwimming

Returns whether this player is swimming or not. **This only works on 1.13 and above** and is used by the vanilla client to render to player the swimming animation.

```csharp
bool IsSwimming();
```

###

### IsSprinting

Returns whether this player is sprinting or not.

```csharp
bool IsSprinting();
```

###

### HasLineOfSight

Returns whether the bot has direct line of sight to this player. This **only works if the player is within 64 blocks of the bot**. You can optionally specify a specific body part to test against (default is BodyParts.Body).

```csharp
bool HasLineOfSight(BodyParts bodyPart = BodyParts.Body);
```

###

### Attack

Attacks this player. This does not move the bot to range, nor does it rotate the bots head to face the player.\
Note: *To be anti-cheat compliant, you must first use the LookAt function to look at the player before hitting it.*

```csharp
void Attack();
void Attack(Hands hand);
```

### Interact

Right-clicks this player. This does not move the bot to range, nor does it rotate the bots head to face the player.\
Note: *To be anti-cheat compliant, you must first use the LookAt function to look at the player before hitting it.*

```csharp
void Interact();
void Interact(Hands hand);
```

###

### LookAt

Rotates the bots head to look at the player. This can be used to look at a specific part of the player, such as the head, feet, or the body (default is BodyParts.Body).\
Returns a Task that lasts around 1 tick, which is how long it takes the server to update the players rotation.

```csharp
Task LookAt(BodyParts bodyPart = BodyParts.Body);
```

### LookAtSmooth

Smoothly (slowly, per multiple ticks) rotates the bots head to look at the player. This can be used to look at a specific part of the player, such as the head, feet, or the body (default is BodyParts.Body).\
You should await for this function to complete, as the rotation time is dynamic. You can optionally specify the look speed, however it is recommended to leave it as 'auto'.

```csharp
Task LookAtSmooth(BodyParts bodyPart = BodyParts.Body, LookSpeed speed = LookSpeed.auto);
```

###

### MoveTo

Attempts to move the location of this player. This is a wrapper function for [Player.MoveTo](https://docs.minecraftbot.com/api/context/player#moveto), for more information check that.

```csharp
IMoveTask MoveTo();
```

### MoveToRange

Attempts to move the bot into the specified range of this player. You must specify the max distance that we can be from this player to still be considered in range. This is a wrapper function for [Player.MoveToRange](https://docs.minecraftbot.com/api/context/player#movetorange), for more information check that.

```csharp
IMoveTask MoveToRange(int maxRange, MapOptions options = null);
```

### Follow

Attempts to move the location of this player, if the player moves then the path is recalculated and updated. This is a wrapper function for [Player.FollowEntity](https://docs.minecraftbot.com/api/context/player#followentity), for more information check that.

```csharp
IMoveTask Follow(MapOptions options = null)
IMoveTask Follow(int maxRange, MapOptions options = null)
IMoveTask Follow(int maxRange, int minRange, MapOptions options = null)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.minecraftbot.com/api/context/entities/iplayerentity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
