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

# Reset Stats via NPC

> Let players reset their stat points through an NPC using the NPC Dialog mod - optional item cost (e.g. Essence of Void) with the NPC Quests addon.

# Reset Stats via NPC

Players normally cannot run `/lvl resetstats` themselves; it is an **admin-only** command. If you want to offer a **self-service stat reset** (for example in a town or hub), you can use the [**NPC Dialog**](https://www.curseforge.com/hytale/mods/npc-dialog) mod so an NPC runs the command for the interacting player.

This guide explains how to set that up. Optionally, you can use the [**NPC Quests**](https://www.curseforge.com/hytale/mods/npc-dialog-npc-quests-maker) addon to require items (e.g. 10 Essence of Void) before the NPC performs the reset.

***

## What the reset does

The command `/lvl resetstats <player>` (see [Commands](commands)):

* Clears all **allocated** stat points for that player
* Returns those points to the **available** stat points pool
* Removes all stat modifiers
* Lets the player reallocate their points (level and total points are unchanged)

When triggered via an NPC, you run it with **`@p`** so the **player who interacted** with the NPC is the one whose stats are reset.

***

## 1. Install NPC Dialog

1. Install [**NPC Dialog**](https://www.curseforge.com/hytale/mods/npc-dialog) on your server (download from CurseForge and add the mod to your server’s mods folder).
2. Restart the server (or load the mod as required by your setup).

NPC Dialog lets you attach multi-page dialogs to any entity. When a player presses **F** on that entity, a dialog opens; you can configure **buttons** (e.g. Custom Button 1, Custom Button 2, or the Close button) to run **server commands**. The mod can run those commands as **console**, so the interacting player does not need OP.

***

## 2. Run the reset command as console

So that the reset works for any player (without giving them OP), the `/lvl resetstats` call must run as **server/console**, not as the player.

In NPC Dialog’s data folder, open **`consoleCommands.json`**. Add **`lvl`** to the list of commands that run as console. For example:

```json theme={null}
{
  "consoleCommands": [
    "give",
    "tp",
    "lvl"
  ]
}
```

Then any command starting with `lvl` (e.g. `lvl resetstats @p`) triggered by an NPC button will run with console permissions and will correctly reset the targeted player.

***

## 3. Create the reset NPC

1. In-game, run **`/npcdialog`** (requires NPC Dialog admin permission).
2. **Create an NPC** (name and title as you like, e.g. “Stat Resetter”, “Void Priest”).
3. **Add dialog content** explaining that this NPC can reset their stat points (and any cost, e.g. “Requires 10 Essence of Void” if you use NPC Quests).
4. Set the **command that runs when the player confirms**:

   * Either set **Custom Button 1** (or Custom Button 2) text to something like **“Reset my stats”** and set its command to:
     * **`lvl resetstats @p`**
   * Or use the **Close** button: set **Close Button Command** to **`lvl resetstats @p`** so that when the player closes the dialog (e.g. after reading), their stats are reset.

   Use **`@p`** so the player who clicked is the one affected. The mod replaces `@p` with that player’s name when running the command.
5. **Link the NPC** to an entity in the world (the one players will press F on).
6. Save.

After that, when a player interacts with that entity and triggers the button (or close) you configured, the server runs `lvl resetstats @p` for them and their stat points are reset as described in [Commands](commands).

***

## 4. (Optional) Require items with NPC Quests

If you use the [**NPC Quests**](https://www.curseforge.com/hytale/mods/npc-dialog-npc-quests-maker) addon for NPC Dialog, you can require items (e.g. **10 Essence of Void**) before the NPC resets the player’s stats.

Example flow:

1. Create a “quest” or interaction that requires the player to hand in **10 Essence of Void** (or whatever item and quantity you choose).
2. When that requirement is met, the NPC Quests logic runs the reward/action - configure that to run **`lvl resetstats @p`** (via NPC Dialog’s command execution, or as provided by the addon).
3. The player only gets the stat reset after paying the cost; you can still use the same NPC and dialog text to explain the cost.

This gives you a clear, in-world way to offer stat resets with a material cost that fits your server’s economy (e.g. Essence of Void as a rare resource).

***

## Summary

| Step | Action                                                                                                                                                         |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1    | Install [NPC Dialog](https://www.curseforge.com/hytale/mods/npc-dialog).                                                                                       |
| 2    | Add **`lvl`** to **`consoleCommands.json`** so the reset runs as console.                                                                                      |
| 3    | Create an NPC, link it to an entity, and set a button or Close command to **`lvl resetstats @p`**.                                                             |
| 4    | *(Optional)* Use [NPC Quests](https://www.curseforge.com/hytale/mods/npc-dialog-npc-quests-maker) to require items (e.g. 10 Essence of Void) before the reset. |

Players can then reset their stat points by talking to your NPC - with or without an item cost - without needing admin commands or OP.
