> For the complete documentation index, see [llms.txt](https://titans.gitbook.io/titans/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titans.gitbook.io/titans/economy-system.md).

# Economy System

````
# Economy and Shop System

This page covers the **Titans economy system**, including the custom currency, player-to-player payments, and the customizable **Shard Shop**.

The economy is centered around **Titan Shards**, a unique currency earned by battling **Titans** and **Invaders**.

Players can spend Titan Shards in the Shard Shop to purchase rare items, boosters, materials, legendary artifacts, and other server-defined rewards.

---

# Economy Overview

| Feature | Description |
|---|---|
| **Titan Shards** | The main currency used by the Titans mod. |
| **Shard Shop** | A GUI shop where players can spend Titan Shards. |
| **Player Payments** | Optional player-to-player shard transfers. |
| **Admin Balance Tools** | Commands for giving, taking, setting, and checking shards. |
| **Custom Shop Items** | Server owners can define shop categories, icons, lore, prices, limits, and commands. |
| **Purchase Limits** | Items can have player-specific and server-wide purchase limits. |
| **Confirmation Menu** | Expensive purchases can require confirmation before completion. |

{% hint style="info" %}
Titan Shards are designed to give players a long-term reason to participate in Titan and Invader fights.
{% endhint %}

---

# Titan Shards

**Titan Shards** are the main currency used by the Titans economy system.

Players can earn shards through boss content, then spend them in the `/titans shop` GUI.

Common uses for Titan Shards include:

- Buying rare materials
- Buying temporary boosters
- Buying legendary artifacts
- Purchasing special event rewards
- Trading shards with other players, if enabled

---

# Economy Configuration

The economy configuration file is located at:

```text
config/titans/econ.yml
````

This file controls the base economy settings, including the currency name, starting balance, and whether player payments are allowed.

***

### Economy Config Options

| Option             | Description                                                                      |
| ------------------ | -------------------------------------------------------------------------------- |
| `starting_balance` | The number of shards a new player starts with.                                   |
| `shard_name`       | The display name of the currency. For example, `Titan Shards`.                   |
| `shard_color`      | The Minecraft color code used for the currency name. For example, `&6` for gold. |
| `pay_enabled`      | If `true`, players can send shards to each other.                                |
| `min_pay_amount`   | The minimum number of shards required for a player-to-player payment.            |

***

### Example Economy Config

```
starting_balance: 0
shard_name: "Titan Shards"
shard_color: "&6"
pay_enabled: true
min_pay_amount: 10
```

***

### Example Breakdown

| Setting            | Value          | Result                                            |
| ------------------ | -------------- | ------------------------------------------------- |
| `starting_balance` | `0`            | New players start with 0 shards.                  |
| `shard_name`       | `Titan Shards` | The currency is displayed as Titan Shards.        |
| `shard_color`      | `&6`           | The currency name appears gold.                   |
| `pay_enabled`      | `true`         | Players can send shards to each other.            |
| `min_pay_amount`   | `10`           | Players must send at least 10 shards per payment. |

{% hint style="warning" %}\
If `pay_enabled` is set to `false`, players will not be able to use `/titans shards pay <player> <amount>`.\
{% endhint %}

***

## Shop Configuration

The shop configuration file is located at:

```
config/titans/shop.yml
```

This file controls the `/titans shop` GUI.

Admins can define shop categories, item icons, item names, lore, prices, purchase limits, reset timers, and reward commands.

***

## Shop Settings

| Option                   | Description                                                                                           |
| ------------------------ | ----------------------------------------------------------------------------------------------------- |
| `confirmation_threshold` | If an item costs more than this amount, a confirmation menu appears before the purchase is completed. |

***

### Confirmation Threshold

The `confirmation_threshold` setting helps prevent players from accidentally buying expensive items.

Example:

```
confirmation_threshold: 1000
```

If an item costs more than `1000` Titan Shards, the player will be asked to confirm the purchase before the commands run.

{% hint style="info" %}\
This is useful for expensive boosters, legendary rewards, or limited-time event items.\
{% endhint %}

***

## Shop Item Options

Each item in the shop can be fully customized.

| Option                   | Description                                                                                |
| ------------------------ | ------------------------------------------------------------------------------------------ |
| `id`                     | Unique internal ID for the shop item.                                                      |
| `category`               | Shop category used to group the item, such as `Materials` or `Boosters`.                   |
| `display_item`           | Minecraft or Pixelmon item ID used as the icon in the GUI.                                 |
| `enchanted`              | If `true`, the display item has the enchantment glow.                                      |
| `name`                   | Display name of the item in the shop. Supports formatting and RGB gradients.               |
| `lore`                   | List of text lines shown under the item.                                                   |
| `price`                  | Cost of the item in Titan Shards.                                                          |
| `player_limit`           | Number of times each player can buy the item. Use `-1` for infinite.                       |
| `global_limit`           | Total number of times the entire server can buy the item. Use `-1` for infinite.           |
| `reset_interval_seconds` | Time in seconds before purchase limits reset. For example, `86400` equals 24 hours.        |
| `commands`               | Console commands that run when the item is purchased. Use `{player}` for the buyer's name. |

***

## Purchase Limits

Shop items can have both player-specific and server-wide limits.

| Limit Type               | Description                                               |
| ------------------------ | --------------------------------------------------------- |
| `player_limit`           | Limits how many times one player can buy the item.        |
| `global_limit`           | Limits how many times the entire server can buy the item. |
| `reset_interval_seconds` | Controls when limits reset.                               |

***

### Purchase Limit Examples

| Config                          | Meaning                                                      |
| ------------------------------- | ------------------------------------------------------------ |
| `player_limit: -1`              | Each player can buy the item infinitely.                     |
| `player_limit: 1`               | Each player can buy the item once per reset interval.        |
| `global_limit: -1`              | The server has no shared purchase limit.                     |
| `global_limit: 10`              | Only 10 total purchases are allowed across the whole server. |
| `reset_interval_seconds: 86400` | Limits reset every 24 hours.                                 |

{% hint style="warning" %}\
Use purchase limits for powerful boosters or rare rewards so they do not flood the server economy.\
{% endhint %}

***

## Reward Commands

The `commands` section controls what happens when a player buys an item.

Commands are run by the console.

Use `{player}` as a placeholder for the player's username.

***

### Command Placeholder

| Placeholder | Description                                                  |
| ----------- | ------------------------------------------------------------ |
| `{player}`  | Replaced with the name of the player who purchased the item. |

***

### Example Commands

```
commands:
  - "give {player} minecraft:diamond 3"
  - "msg {player} &aYou purchased diamonds from the Shard Shop!"
```

When the player buys this item:

* The console gives them 3 diamonds.
* The player receives a confirmation message.

***

## Example Shop Entry

```
items:
  - id: "damage_booster_1hr"
    category: "Boosters"
    display_item: "minecraft:blaze_powder"
    enchanted: true
    name: "&#FF4B2B:#FF416C:bTitan Damage Booster (1hr)"
    lore:
      - "&7Infuse your team with power!"
      - "&fEffect: &e+20% Damage to Titans"
      - "&fDuration: &a60 Minutes"
    price: 1000
    player_limit: 1
    global_limit: -1
    reset_interval_seconds: 86400
    commands:
      - "titanmultiplier player {player} 1.2 60"
      - "msg {player} &aBooster activated!"
```

***

## Example Breakdown

### Titan Damage Booster

This shop entry creates a purchasable **Titan Damage Booster**.

| Setting        | Value                      |
| -------------- | -------------------------- |
| Item ID        | `damage_booster_1hr`       |
| Category       | `Boosters`                 |
| Display Item   | `minecraft:blaze_powder`   |
| Enchanted Glow | `true`                     |
| Price          | `1000` Titan Shards        |
| Player Limit   | `1` purchase               |
| Global Limit   | Infinite                   |
| Reset Interval | `86400` seconds / 24 hours |

***

### Booster Effect

When purchased, this item runs:

```
titanmultiplier player {player} 1.2 60
```

This gives the buyer a `1.2x` damage multiplier for `60` minutes.

It also runs:

```
msg {player} &aBooster activated!
```

This sends the player a confirmation message.

***

## Shop Categories

Shop categories help organize items inside the `/titans shop` GUI.

Example categories:

| Category      | Example Items                                           |
| ------------- | ------------------------------------------------------- |
| `Materials`   | Rare crafting materials, evolution items, shards, gems. |
| `Boosters`    | Damage boosters, XP boosters, drop boosters.            |
| `Artifacts`   | Legendary items, rare tools, special keys.              |
| `Cosmetics`   | Particles, titles, tags, visual effects.                |
| `Event Items` | Limited-time rewards during Titan or Invader events.    |

{% hint style="info" %}\
Categories make the shop easier to browse, especially on servers with many custom rewards.\
{% endhint %}

***

## Commands and Permissions

The economy system includes player commands and admin commands.

***

## Player Commands

These commands require:

```
titans.use
```

| Command                                | Description                                                                |
| -------------------------------------- | -------------------------------------------------------------------------- |
| `/titans shop`                         | Opens the main Shard Shop GUI where players can browse and purchase items. |
| `/titans shards`                       | Checks your current Titan Shard balance.                                   |
| `/titans shards pay <player> <amount>` | Sends shards to another player, if `pay_enabled` is `true`.                |

***

### Player Command Examples

```
/titans shop
```

Opens the Shard Shop.

```
/titans shards
```

Shows your current Titan Shards balance.

```
/titans shards pay Steve 250
```

Sends `250` Titan Shards to Steve, if payments are enabled.

***

## Admin Commands

These commands require:

```
titans.admin
```

| Command                                        | Description                                          |
| ---------------------------------------------- | ---------------------------------------------------- |
| `/titans shards <player>`                      | Checks the shard balance of any player.              |
| `/titans shards admin give <targets> <amount>` | Adds shards to the specified players' balances.      |
| `/titans shards admin take <targets> <amount>` | Removes shards from the specified players' balances. |
| `/titans shards admin set <targets> <amount>`  | Forces a player's shard balance to a specific value. |

***

### Admin Command Examples

```
/titans shards Steve
```

Checks Steve's Titan Shard balance.

```
/titans shards admin give Steve 1000
```

Gives Steve `1000` Titan Shards.

```
/titans shards admin take Steve 500
```

Removes `500` Titan Shards from Steve.

```
/titans shards admin set Steve 2500
```

Sets Steve's Titan Shard balance to `2500`.

***

## Full Economy Flow

```
Player fights Titans or Invaders
↓
Player earns Titan Shards
↓
Player opens /titans shop
↓
Player buys an item
↓
Console runs configured reward commands
↓
Player receives the reward
```

***

## Recommended Shop Design

| Shop Type       | Recommended Setup                                                   |
| --------------- | ------------------------------------------------------------------- |
| Basic Materials | Low prices, no confirmation needed, high or infinite limits.        |
| Damage Boosters | Medium to high prices, confirmation enabled, daily player limit.    |
| Rare Artifacts  | High prices, confirmation enabled, strict player and global limits. |
| Event Rewards   | Limited-time categories with reset intervals.                       |
| Cosmetics       | Medium prices, usually infinite or one-time purchase limits.        |

***

## Quick Summary

| System                   | Purpose                                            |
| ------------------------ | -------------------------------------------------- |
| `econ.yml`               | Controls Titan Shard economy settings.             |
| `shop.yml`               | Controls the Shard Shop GUI and purchasable items. |
| `Titan Shards`           | Main currency earned from Titans and Invaders.     |
| `/titans shop`           | Opens the Shard Shop.                              |
| `/titans shards`         | Shows shard balance.                               |
| `/titans shards pay`     | Allows player-to-player shard transfers.           |
| `confirmation_threshold` | Adds confirmation menus for expensive purchases.   |
| `player_limit`           | Limits purchases per player.                       |
| `global_limit`           | Limits purchases server-wide.                      |
| `commands`               | Runs console commands when an item is bought.      |


---

# 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://titans.gitbook.io/titans/economy-system.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.
