> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sentrystudios.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugin Hooks & Integrations

> How to tie SentryWipe into the rest of your server's ecosystem.

Minecraft's vanilla `.dat` files only store a fraction of a player's data. Most progression is stored across various third-party plugins. SentryWipe solves this by offering a deeply customizable hooks system via `hooks.yml`.

SentryWipe supports three execution modes for external plugins: **API**, **MAPPED**, and **RAW**.

***

## Execution Modes Explained

<Tabs>
  <Tab title="API Mode">
    **Recommended whenever supported.** Uses SentryWipe's internal API directly against the target plugin's API.

    * **Pros:** Fastest, safest, and most stable option. Not affected by command changes, aliases, or server lag.
    * **Supported Plugins:** `luckperms`, `vault`, `placeholderapi`
  </Tab>

  <Tab title="MAPPED Mode">
    **Recommended fallback mode.** Uses internal SentryWipe action keys mapped to server-specific commands. It provides a safety net while still executing commands.

    * **Pros:** Flexible and easy to customize if the target plugin changes its base command structure.
    * **Supported Plugins:** `essentials`, `cmi`
  </Tab>

  <Tab title="RAW Mode">
    **Legacy compatibility mode.** Executes a list of raw console commands exactly as written whenever the hook is triggered.

    * **Pros:** Allows you to hook into **literally any plugin** that exists, even if SentryWipe doesn't officially support it.
    * **Cons:** Fragile. If the plugin's command syntax changes, the wipe will fail.
  </Tab>
</Tabs>

***

## Native API Hooks

These hooks are hardcoded into SentryWipe for maximum efficiency.

### LuckPerms

When enabled, SentryWipe will strip the player of all parent groups, tracks, and individual permission nodes, effectively returning them to the `default` group.

### Vault

When enabled, SentryWipe directly modifies the player's economy balance via the Vault API (setting it to 0). This is far safer than running economy commands.

***

## Configuring MAPPED Hooks

MAPPED hooks define a dictionary of actions.

```yaml hooks.yml theme={null}
essentials:
  enabled: true
  mode: MAPPED
  priority: 1
  actions:
    HOME_CLEAR: "delhome %player%:*"
    NICK_RESET: "nick %player% off"
    MAIL_RESET: "mail clear %player%"
    KIT_COUNT_RESET: "kit resetcount * %player%"
    GOD_DISABLE: "god %player% off"
    FLY_DISABLE: "fly %player% off"
    SPEED_RESET: "speed walk 1 %player%"
```

If you ever change Essentials' base command (e.g., using `essentials:delhome`), you can modify it safely here without waiting for an update to SentryWipe.

***

## Creating RAW Hooks (Custom Plugins)

RAW mode is an incredibly powerful feature. It allows you to build custom integrations for plugins SentryWipe doesn't natively know about.

We have included several raw templates for popular plugins like `mcmmo`, `auraskills`, and `jobs`, but you can create your own!

### Example: Wiping PlayerPoints

```yaml theme={null}
playerpoints:
  enabled: true
  mode: RAW
  priority: 10 # Executes after API hooks
  commands:
    - "points set %player% 0"
```

### Example: Wiping GriefPrevention Claims

```yaml theme={null}
griefprevention:
  enabled: true
  mode: RAW
  priority: 10
  commands:
    - "deleteallclaims %player%"
    - "adjustbonusclaimblocks %player% 0"
```

### Example: Wiping SentrySettings

```yaml theme={null}
hooks:
  sentrysettings:
    enabled: true
    priority: 15
    mode: COMMANDS
    commands:
      - "settings wipe %player%"
```

### How to Trigger Custom Hooks

Once you have defined a hook in `hooks.yml` (for example, `griefprevention`), you **must** add it to the `actions` list of your desired preset in `presets.yml`.

```yaml presets.yml theme={null}
presets:
  full:
    display: "&cFull Wipe"
    actions:
      inventory: true
      playerdata: true
      
      # Ensure the name matches the key in hooks.yml!
      griefprevention: true 
```

Now, whenever the `full` preset is run, SentryWipe will execute the commands defined under the `griefprevention` hook.<br /><br />
