> For the complete documentation index, see [llms.txt](https://docs.quickclient.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickclient.cc/en/actions/control.md).

# Movement

Sprinting, sneaking, jumping, player velocity and camera settings.

`control()` handles sprinting, sneaking, jumping and the player's velocity. It writes values directly to the local player and to some of the game settings.

Sprint, sneak, jump and velocity last exactly one tick, because the game collects input and movement again every tick. For a lasting effect, call the methods every tick. The script writes its values after Quick's modules, so if the script sets something explicitly, its value is used.

```java
@Override
public void onTick() {
    control().sprinting(true);
    if (player().onGround()) control().jump();
}
```

## Input

| Method             | Type      | Description                             |
| ------------------ | --------- | --------------------------------------- |
| `sprinting(value)` | `void`    | keep sprinting this tick                |
| `sprinting()`      | `boolean` | whether the player is sprinting         |
| `sneaking(value)`  | `void`    | keep sneaking this tick                 |
| `sneaking()`       | `boolean` | whether the player is sneaking          |
| `jump()`           | `boolean` | jump this tick; does nothing in the air |

## Velocity

| Method            | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| `motion(x, y, z)` | `void` | velocity the player moves with this tick, in blocks per tick |

The velocity is set right before movement, once input is already collected. In one tick the player moves by this velocity plus a small extra amount from the pressed keys. Gravity and air drag are applied after the move, so to hold a velocity, call the method every tick. The best place for this is the `input` event, where the input itself is also available. If the player jumps off the ground in the same tick, the jump replaces the Y velocity.

```java
on("input", event -> {
    Object[] input = (Object[]) event.payload();
    boolean jump = (Boolean) input[2];
    if (!jump) control().motion(0d, 0d, 0d);
});
```

## How it works

The player stays in place until jump is pressed. The jump is stored in `input[2]`.

Coordinates cannot be set directly. The position is changed through velocity or through [packets](/en/actions/packets.md).

## Camera and settings

| Method               | Type      | Description                                                                         |
| -------------------- | --------- | ----------------------------------------------------------------------------------- |
| `perspective()`      | `int`     | `Control.FIRST_PERSON`, `THIRD_PERSON_BACK`, `THIRD_PERSON_FRONT`                   |
| `perspective(value)` | `void`    | change the view                                                                     |
| `firstPerson()`      | `boolean` | whether first person view is on                                                     |
| `sensitivity()`      | `double`  | mouse sensitivity 0..1                                                              |
| `sensitivity(value)` | `void`    | set the sensitivity; the previous value is not restored when the script is disabled |
| `guiScale()`         | `double`  | GUI scale; pixels divided by it give `Render2D` units                               |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.quickclient.cc/en/actions/control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
