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

# Sandbox and limits

Which packages scripts can use, what is closed and which limits apply.

Quick compiles scripts itself and checks what they access. The bytecode of every class from `java/` goes through a verifier. If the code references a closed class, the jar does not load and the console shows the reason as `<class>: <violation>`.

The sandbox does not check mixins from `mixin/`, they are covered on the [Mixins and hooks](/en/extras/mixins.md) page.

## What is open

| Package                 | What it is                                               |
| ----------------------- | -------------------------------------------------------- |
| `hex.script.api`        | the script API, together with `hex.script.api.event`     |
| `java.lang`             | strings, numbers, `Math`, exceptions, `Runnable`         |
| `java.util`             | collections, `Random`, `Optional`, functional interfaces |
| `java.math`             | `BigInteger`, `BigDecimal`                               |
| `java.time`             | time and dates                                           |
| `java.text`             | formatting                                               |
| `org.joml`              | vectors and matrices                                     |
| `it.unimi.dsi.fastutil` | fast collections for primitives                          |

## What is closed

| Area                                                                                      | Why                                                                                     |
| ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `net.minecraft`, `com.mojang`, `io.netty`                                                 | game and network classes; everything you need is already wrapped in the API             |
| client internals                                                                          | everything outside `hex.script.api`                                                     |
| `java.io`, `java.nio`, `java.net`, `java.security`                                        | files and network; read through `assets()`, write through `storage()`                   |
| `java.lang.reflect`, `java.lang.ref`, `java.lang.module`, `java.lang.annotation`          | reflection and bypassing checks                                                         |
| `java.util.concurrent`, `Thread`, `ThreadLocal`, `ThreadGroup`                            | own threads; everything runs on the game thread, background work goes through `tasks()` |
| `Runtime`, `Process*`, `ClassLoader`, `Module*`, `SecurityManager`                        | starting processes and loading code                                                     |
| `java.util.jar`, `java.util.zip`, `java.util.logging`, `java.util.prefs`, `java.util.spi` | disk access that bypasses the API                                                       |
| `jdk.*`, `sun.*`, `com.sun.*`                                                             | internal JDK packages                                                                   |

The deprecated `Render2D.context()`, `Render2D.renderState()` and `Script.target()` return vanilla objects typed as `Object`. You cannot use them anyway, because game classes are closed. These methods will be removed soon.

## What a script can see

* Only its own `resources/` folder and its own configs in `.data/<script>/`.
* The real nickname through `client().username()`, and `protectedUsername()` for drawing.
* If a script reads the clipboard, it shows in the console.
* Tokens, sessions and account data are not given to scripts.

## Limits

| What                         | Limit                                                |
| ---------------------------- | ---------------------------------------------------- |
| file inside a jar            | 32 MB                                                |
| `world().scan` radius        | 32                                                   |
| `world().find` radius        | 64, up to 65536 results, 4096 by default             |
| `particles().spawn` cloud    | 1..512 particles                                     |
| `sounds().play`              | volume 0..16, pitch 0.5..2                           |
| `prediction().after`         | 1..100 ticks                                         |
| `rotations().apply` priority | 0..40, Quick's combat modules always take precedence |

## What Quick does with a crashed script

If an exception is thrown in a callback, event, task, command or hook, Quick disables the script and writes the reason to the console: "`<name>` disabled: `<exception>`". Until the next reload the script counts as crashed and its row in the list is red. Other scripts keep working.

If one file fails to compile, the others are not affected. The console shows "files not built: N, the rest loaded", and the full list of problems is shown by `.script reload`, or by the `script_write` response if an AI agent is writing the script.


---

# 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/extras/limits.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.
