> For the complete documentation index, see [llms.txt](https://novoline.gitbook.io/novoscript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://novoline.gitbook.io/novoscript/api/objects-1/player.md).

# Player

## player.jump

Makes the player jump

```
player.jump()
```

## player.setPosition

| Parameters | Type   | Description  |
| ---------- | ------ | ------------ |
| x          | double | x coordinate |
| y          | double | y coordinate |
| z          | double | z coordinate |

```
player.setPosition(x,y,z)
```

## player.getBaseMoveSpeed

Returns the player base move speed

```
player.getBaseMoveSpeed() - double
```

## player.setSpeed

Sets the player speed

| Parameters | Type   |
| ---------- | ------ |
| speed      | double |

```
player.setSpeed(speed);
```

## player.getSpeed

Returns the player motion speed

```
player.getSpeed() - double
```

## player.isOnGround

Returns the ground state of a player

```
player.isOnGround() - boolean
```

## player.setOnGround

Sets player ground state

| Parameters | Type    |
| ---------- | ------- |
| state      | boolean |

```
player.setOnGround(state);
```

## player.getName

Returns the player name

```
player.getName() - string
```

## player.getLastTickDistance

Returns the distance travelled during the last tick

```
player.getLastTickDistance() - double
```

## player.getHeldItemName

Returns unlocalized name of the held item

```
player.getHeldItemName() - string
```

## player.getHeldItemDisplayName

Returns the display name of the held item

```
player.getDisplayName() - string
```

## player.getTagCompound

Returns the tag compound string of the held item

```
player.getTagCompound() - string
```

## player.setMotionX

Sets the player motion X. Returns the motion you set

| Parameters | Type   |
| ---------- | ------ |
| motionX    | double |

```
player.setMotionX(motionX) - double
```

## player.setMotionY

Sets the player motion Y. Returns the motion you set

| Parameters | Type   |
| ---------- | ------ |
| motionY    | double |

```
player.setMotionY(motionY) - double
```

## player.setMotionZ

Sets the player motion Z. Returns the motion you set

| Parameters | Type   |
| ---------- | ------ |
| motionZ    | double |

```
player.setMotionY(motionZ) - double
```

## player.getX

Returns the X position of a player

```
player.getX() - double
```

## player.getY

Returns the Y position of a player

```
player.getY() - double
```

## player.getZ

Returns the Z position of a player

```
player.getZ() - double
```

## player.setX

Sets the X position for the player. Returns the position you set

| Parameters | Type   |
| ---------- | ------ |
| x          | double |

```
player.setX(x) - double
```

## player.setY

Sets the Y position for the player. Returns the position you set

| Parameters | Type   |
| ---------- | ------ |
| y          | double |

```
player.setY(y) - double
```

## player.setZ

Sets the Z position for the player. Returns the position you set

| Parameters | Type   |
| ---------- | ------ |
| z          | double |

```
player.setZ(z) - double
```

## player.attackEntity

Attacks the entity you provide

| Parameters | Type   |
| ---------- | ------ |
| entity     | Entity |

```
player.attackEntity(entity)
```

## player.getDistanceToEntity

Returns a distance from the player to an entity in blocks

| Parameters | Type   |
| ---------- | ------ |
| entity     | Entity |

```
player.getDistanceToEntity(entity)
```

## player.getDistanceToEntity2D

Returns a distance from the player to an entity in blocks (XZ axis only)

| Parameters | Type   |
| ---------- | ------ |
| entity     | Entity |

```
player.getDistanceToEntity2D(entity)
```

## player.swingItem

Makes the player swing the item

```
player.swingItem()
```

## player.getFallDistance

Returns player's fall distance in blocks

```
player.getFallDistance() - double
```

## player.getHeldItem

Returns the held item of a player

```
player.getHeldItem() - ItemStack
```

## player.isMoving

Returns true if the player is moving

```
player.isMoving() - boolean
```

## player.getHealth

Returns the health of the player (number of hearts multiplied by 2)

```
player.getHealth() - double
```

## player.sendMessage

Sends the message you provide in the chat

| Parameters | Type   |
| ---------- | ------ |
| message    | String |

```
player.sendMessage(message)
```

## player.getDisplayName

Returns the display name of a player

```
player.getDisplayName()
```

## player.setSlot

Sets the current slot to the slot you provide

| Parameters | Type    |
| ---------- | ------- |
| slotId     | Integer |

```
player.setSlot(slotId)
```

## player.getHurtTime

Returns the hurt timer of the player

```
player.getHurtTime() - Integer
```

## player.getHurtResistantTimer

Returns the hurt resistant time of a player

```
player.getHurtResistantTime() - Integer
```

## player.getFoodLevel

Returns the food level of a player

```
player.getFoodLevel() - Integer
```

## player.isBurning

Returns true if the player is burning

```
player.isBurning() - boolean
```

## player.leftClick

Left clicks

```
player.leftClick()
```

## player.rightClick

Right Clicks

```
player.rightClick()
```

## player.isInWater

Returns true if the player is in water

```
player.isInWater() - boolean
```

## player.isInLava

Returns true if the player is in lava

```
player.isInLava() - boolean
```

## player.isSneaking

Returns true if the player is sneaking

```
player.isSneaking() - boolean
```

## player.setSneaking

Sets the player's sneaking state

| Parameters | Type    |
| ---------- | ------- |
| state      | Boolean |

```
player.setSneaking(state)
```

## player.isRiding

Returns true if the player is riding an entity

```
player.isRiding() - Boolean
```

## player.isCollidedVertically

Returns true if the player is collided vertically

```
player.isCollidedVertically() - Boolean
```

## player.isCollidedHorizontally

Returns true if the player is collided vertically

```
player.isCollidedHorizontally() - Boolean
```

## player.ticksExisted

Returns the amount of ticks player exists in the world

```
player.ticksExisted() - Integer
```

## player.setYaw

Sets the player rotation yaw

| Parameters | Type  |
| ---------- | ----- |
| angle      | float |

```
player.setYaw(angle)
```

## player.setPitch

Sets the player rotation pitch

| Parameters | Type  |
| ---------- | ----- |
| angle      | float |

```
player.setPitch(angle)
```

## player.getUUID

Returns the unique ID of the player

```
player.getUUID() - UUID
```

## player.getPrevPosX

Returns the previous position X of the player

```
player.getPrevPosX() - double
```

## player.getPrevPosY

Returns the previous position Y of the player

```
player.getPrevPosY() - double
```

## player.getPrevPosZ

Returns the previous position Z of the player

```
player.getPrevPosZ() - double
```
