> For the complete documentation index, see [llms.txt](https://scripting.breeze.rip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripting.breeze.rip/spoof_manager.md).

# Spoof Manager

The `spoofManager` namespace lets your script intercept, cancel, delay, and release packets in both directions. Like the rotation manager, it uses a priority system for when multiple scripts are active.

This manager is mainly meant for making lag based modules. For basic packet manipulation we recommend [PacketSendEvent](/api/events/packetsendevent.md).

***

### Setup

Set your priority during initialization.

```javascript
spoofManager.setPriority(10);
```

***

### Intercepting Packets

#### `onPacketSend`

Called for every outbound packet (client → server). Return a `SpoofAction` to decide what happens to it.

```javascript
spoofManager.onPacketSend((packet) => {
    if (packet instanceof C0BPacketEntityAction) {
        if (packet.getAction() === "START_SNEAKING") {
            return "CANCEL"; // block sneak packets from reaching the server
        }
    }
    return "PROCESS"; // let everything else through
});
```

***

#### `onPacketReceive`

Called for every inbound packet (server → client). Same `SpoofAction` return values apply.

```javascript
spoofManager.onPacketReceive((packet) => {
    if (packet instanceof S08PacketPlayerPosLook) {
        return "DELAY"; // hold the teleport packet until we're ready
    }
    return "PROCESS";
});
```

***

### SpoofAction Values

| Value       | Description                                           |
| ----------- | ----------------------------------------------------- |
| `"PROCESS"` | Do nothing, let the packet continue as normal         |
| `"CANCEL"`  | Drop the packet entirely — it will never be processed |
| `"DELAY"`   | Hold the packet until you manually release it         |

### Releasing Delayed Packets

#### `onUpdate`

Called every tick when there are delayed packets waiting. Use this to decide when to release them.

```javascript
spoofManager.onUpdate((packets) => {
    for (let packet of packets) {
        if (packet.hasAged(1000)) { // release after 1 second
            spoofManager.release(packet);
        }
    }
});
```

Each `DelayedPacket` exposes:

| Property / Method | Description                                                       |
| ----------------- | ----------------------------------------------------------------- |
| `packet`          | The original `Packet` object                                      |
| `time`            | Epoch ms timestamp of when it was delayed                         |
| `direction()`     | `"IN"` or `"OUT"`                                                 |
| `hasAged(ms)`     | `true` if the packet has been held for at least `ms` milliseconds |

### Flushing Packets

If you need to release everything at once — for example when the script is disabled — use the flush helpers.

```typescript
spoofManager.flushAll();      // release all delayed packets
spoofManager.flushIncoming(); // release only inbound packets
spoofManager.flushOutgoing(); // release only outbound packets
```

> Always call `flushAll()` in your `script.onDisable` callback to avoid packets being stuck indefinitely.

***

### Sending Packets Manually

You can also inject your own packets directly to the server.

```typescript
spoofManager.sendPacket(new C05PacketPlayerLook(90.0, 0.0, true), false);
```

{% hint style="info" %}
See [https://github.com/LoseBypass/breeze-docs/blob/main/docs/examples/page-1.md](https://github.com/LoseBypass/breeze-docs/blob/main/docs/examples/page-1.md "mention") for a basic implementation of the spoof manager.
{% endhint %}


---

# 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://scripting.breeze.rip/spoof_manager.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.
