# Custom Player Stats

## What are player stats?

They custom attributes added by ItemsAdder, you can add and read them using a special command: `/iaplayerstat`

You can then use **PlaceholderAPI** to show them anywhere or bind them to a HUD.\
I did that to create thirst and mana. Check my [default configs](https://github.com/search?q=repo%3AItemsAdder%2FDefaultPack+player_stat_name\&type=code) for examples.

### Example:

`/iaplayerstat write LoneDev thirst 6`\
`/iaplayerstat read LoneDev thirst float`

## Saving player stats

### Custom NBT file

Saving them into a custom NBT file handled by ItemsAdder which can be later deleted easily.\
This file is saved into `plugins\ItemsAdder\storage\players\stats\` folder.

```yaml
player_stats:
  save_type: CUSTOM_NBT
```

<figure><img src="/files/n1mieTsAvjWVgOSxfH3j" alt=""><figcaption></figcaption></figure>

### player.dat file

Saving them into the vanilla `player.dat` file.\
This is useful if you want to sync your server and you already sync the player dat files.

```yaml
player_stats:
  save_type: PLAYER_DAT
```

<figure><img src="/files/KttySmZI9xzuHcnNJ5nO" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://itemsadder.devs.beer/other/custom-player-stats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
