# Economy & Purchasing System

AliienResize features a highly advanced, multi-provider economy system. Whether you run a simple Survival server with Vault, or a complex Network using Redis databases and multiple currencies, you can seamlessly sell chat colors to your players directly through the GUI.

***

### ⚙️ How to Enable or Disable Prices

You have complete control over which colors are sold and which are given away. You can toggle the economy requirement for each specific color inside your `sizes.yml`.

To **disable** purchasing for a color, you can either completely delete the `price:` section from that color, or simply set `enabled: false`.

```yaml
    price:
      enabled: true
      currency: "VAULT" # Change this to your economy identifier
      amount: 5000.0
```

*Note: If a player already has the permission node for a color, the plugin will never attempt to charge them for it, even if a price is set!*

***

### 🏦 Supported Economy Types

AliienChatColor natively supports almost every major Spigot economy plugin. To use a specific economy for a color, just change the `currency:` field in `config.yml` to match one of the supported IDs.

**Supported Currency IDs:**

* `VAULT` (Standard Vault money)
* `PLAYERPOINTS` (Premium currency)
* `EXPERIENCE` (Vanilla XP levels)
* `COINSENGINE_` + `[CurrencyName]` (e.g., `COINSENGINE_GEMS`)
* `ECOBITS_` + `[CurrencyName]`
* `EXCELLENTECONOMY_` + `[CurrencyName]`
* `REDISECONOMY_` + `[CurrencyName]`
* `ULTRAECONOMY_` + `[CurrencyName]`
* `ROYALEECONOMY`
* `CUSTOM_` + `[CurrencyName]` (Scroll down to see how to add a custom economy)

*Example: Selling a color for 50 RedisEconomy Tokens:*

```yaml
    price:
      enabled: true
      currency: "REDISECONOMY_TOKENS"
      amount: 50.0
```

> **Note**: if you are using any currency option, make sure to leave vault always enable in order to grant the color permission once a player makes a purchase (hence why vault is a required depenency if you are using the economy feature)

***

### 🛠️ The Custom Economy System (PlaceholderAPI)

If you are using an obscure or custom-coded economy plugin that isn't on the natively supported list, you can still use it! AliienChatColor includes a **Custom Economy Adapter** that uses PlaceholderAPI to check balances and console commands to take the money.

#### Step 1: Define the Custom Currency in `settings.yml`

Open your `settings.yml` and locate the `custom-economy` section. You can create as many custom currencies as you want here. You must provide a PAPI placeholder that returns a raw number, and a console command to withdraw the funds.

```yaml
hooks:
  custom-economy:
    enabled: true
    currencies:
      event_tokens: # This is your Custom ID
        balance-placeholder: "%tokens_balance%"
        withdraw-command: "tokens remove %player% %amount%"
      voting_points:
        balance-placeholder: "%votingplugin_points%"
        withdraw-command: "adminpay %player% -%amount%"
```

#### Step 2: Use it in your `sizes.yml`

To use your new custom currency, add `CUSTOM_` in front of the ID you created in Step 1.

```yaml
    price:
      enabled: true
      currency: "CUSTOM_EVENT_TOKENS" # Uses the event_tokens setup from settings.yml!
      amount: 100.0
```


---

# 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://aliien.gitbook.io/aliien-docs/aliienresize/economy-and-purchasing-system.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.
