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

# Configure NxShards: Database, Shop, Wand, and Messages

> Customize the NxShards config.yml — database backend, shop items, selection wand, transfer limits, and every plugin message in one file.

NxShards configuration is split across a few YAML files inside `plugins/NxShards/`. `config.yml` holds the database backend, transfer limits, wand material, and messages; `shop.yml` defines the GUI shop and its action-based purchase flow.

## File Location

```text theme={null}
plugins/
└── NxShards/
    ├── config.yml
    ├── shop.yml
    └── database.db   # SQLite only
```

After editing `config.yml`, run `/shards reload` to apply changes without restarting the server.

## Database

Choose between MySQL (multi-server sync) and SQLite (local storage):

```yaml theme={null}
storage:
  type: SQLITE          # MYSQL | SQLITE
  host: "127.0.0.1"
  port: 3306
  database: "minecraft"
  username: "root"
  password: "yourpassword"
```

<Note>
  SQLite stores data in `plugins/NxShards/database.db`. Use MySQL when you need a shared Shards balance across multiple servers.
</Note>

## Transfer Limits

Protect the economy by capping how many Shards a player can send through `/shards pay`:

```yaml theme={null}
transfer:
  max-amount: 10000     # Maximum Shards per /shards pay
  cooldown-seconds: 5   # Optional cooldown between transfers
```

## Selection Wand

Customise the wand material and visual feedback used by `/shards wand`:

```yaml theme={null}
wand:
  material: BLAZE_ROD
  display-name: "&6Shards Zone Wand"
  lore:
    - "&7Left-click to set Position 1"
    - "&7Right-click to set Position 2"
```

## Shop

The GUI opened by `/shards shop` lives in a dedicated `shop.yml` file. Each item defines its icon, slot, and a list of **actions** that run sequentially when a player clicks it. The most common action is `[shards] <amount>` which charges the player; other actions execute console commands, send messages, play sounds, or show titles.

```yaml theme={null}
shop:
  title: "&8Tienda de Shards"
  rows: 3
  items:
    example_item:
      material: DIAMOND
      name: "&bDiamante Gratis"
      lore:
        - "&7Costo: &b5 Shards"
        - "&7"
        - "&eClick para comprar"
      slot: 13
      actions:
        - "[shards] 5"
        - "[console] give %player% diamond 1"
        - "[message] &aHas comprado un diamante!"
        - "[title] &a¡Compra Exitosa!;&b1x Diamante"
        - "[sound] ENTITY_PLAYER_LEVELUP"
```

### Available Actions

| Action                       | Description                                                                                     |
| ---------------------------- | ----------------------------------------------------------------------------------------------- |
| `[shards] <amount>`          | Charges the player the given number of Shards. Aborts the chain if the balance is insufficient. |
| `[console] <command>`        | Runs a command from the console. Supports `%player%`.                                           |
| `[player] <command>`         | Forces the player to run a command.                                                             |
| `[message] <text>`           | Sends a chat message to the buyer. Supports `&` color codes.                                    |
| `[title] <title>;<subtitle>` | Shows a title and subtitle, separated by `;`.                                                   |
| `[sound] <SOUND_NAME>`       | Plays a Bukkit sound to the buyer.                                                              |

## Messages

Every user-facing string is editable in the same file. Use legacy `&` colour codes:

```yaml theme={null}
messages:
  prefix: "&8[&6Shards&8] &7"
  balance: "&aYou have &6%amount% Shards&a."
  pay-sent: "&aYou sent &6%amount% Shards &ato &e%target%&a."
  pay-received: "&aYou received &6%amount% Shards &afrom &e%sender%&a."
  not-enough: "&cYou don't have enough Shards."
  zone-enter-title: "&6AFK Zone"
  zone-enter-subtitle: "&7You are now earning Shards"
  zone-bossbar: "&6Earning Shards — &e%zone%"
  no-permission: "&cYou don't have permission."
```

## AFK Zone Defaults

Set fallback values used when admins don't supply an interval or amount on `/shards zone create`:

```yaml theme={null}
zones:
  default-interval-seconds: 60
  default-amount: 1
  bossbar:
    color: GOLD          # GOLD | RED | GREEN | BLUE | YELLOW | PINK | WHITE | PURPLE
    style: SOLID         # SOLID | SEGMENTED_6 | SEGMENTED_10 | SEGMENTED_12 | SEGMENTED_20
```

## Reloading

Apply changes with:

```text theme={null}
/shards reload
```

This reloads the configuration, messages, and the in-memory AFK zone registry without disconnecting players.
