> 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/prediction.md).

# Prediction

Where the player will be in a few ticks and projectile trajectories.

`prediction()` shows where the player will be in a few ticks and where a projectile will land. Movement is simulated on Quick's shadow player, and projectile flight is calculated with the same ballistics Quick itself uses.

```java
Motion landing = prediction().after(10);
if (landing != null) {
    Point at = landing.position();
    render.box(at.x() - 0.3, at.y(), at.z() - 0.3, at.x() + 0.3, at.y() + 0.1, at.z() + 0.3, 0xFFFF3B30, true);
}

Trajectory arrow = prediction().projectile("arrow");
if (arrow.lands()) render.tracer(arrow.landing().x(), arrow.landing().y(), arrow.landing().z(), -1, true);
```

## How it works

* The first block draws a red pad where the player will be in 10 ticks.
* The second one draws a line to the point where an arrow would land if shot right now.

| Method                         | Type           | Description                                                                                 |
| ------------------------------ | -------------- | ------------------------------------------------------------------------------------------- |
| `after(ticks)`                 | `Motion`       | player state after N ticks, 1..100; `null` if the player is not in a world                  |
| `path(ticks)`                  | `List<Motion>` | the whole path tick by tick, tick zero not included                                         |
| `projectile(kind)`             | `Trajectory`   | flight along the current view with default power                                            |
| `projectile(kind, aim, power)` | `Trajectory`   | `aim` sets the direction, `null` uses the last sent rotation; `power` 0 means default power |

Projectiles: `"arrow"`, `"trident"`, `"pearl"`, `"snowball"`, `"potion"`.

The calculation starts from the current input: if W is held, the shadow player also walks forward. Actions the script has already performed through `control()` this tick are taken into account as well.

## Motion

| Method                                   | Type      | Description                 |
| ---------------------------------------- | --------- | --------------------------- |
| `position()`                             | `Point`   | position of the feet        |
| `velocity()`                             | `Point`   | velocity in blocks per tick |
| `onGround()`, `inWater()`, `sprinting()` | `boolean` | state on that tick          |

## Trajectory

| Method          | Type          | Description                                |
| --------------- | ------------- | ------------------------------------------ |
| `points()`      | `List<Point>` | points tick by tick                        |
| `lands()`       | `boolean`     | whether the projectile hits something      |
| `landing()`     | `Point`       | hit point, or `null`                       |
| `flightTicks()` | `int`         | how many ticks the projectile is in flight |


---

# 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/prediction.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.
