# Addons

### Introduction

Addons function as independent modules that can interact with the server's core functions, adding new mechanics and improving gameplay. Thanks to this system, it's possible to manage custom content, such as **vouchers**, reward systems, events, and more, without the need to make drastic changes to the core.

### ⚙️ Features

* **Modularity** – Addons are loaded and managed independently, which facilitates their maintenance and updates.
* **Integration** – Allows you to create and extend existing commands without conflicts.
* **Flexible configuration** – Uses configuration files to modify each addon's behavior without having to edit code.
* **Event compatibility** – Addons can react to server events and execute actions in response.
* **Optimization** – Designed to minimize performance impact, ensuring a smooth experience for players.

## 🚀 Usage Examples

### 🎟️ Voucher System

One of the most used addons is the **voucher system**, which allows players to receive rewards in the form of custom items.

**Main commands:**

* `/therewards voucher giveall <type> <amount>` – Gives a voucher to all connected players.
* `/therewards voucher takeall <type> <amount>` – Removes a specific amount of vouchers from all connected players.

These commands facilitate the distribution of rewards and the administration of special items on the server.

### 🔧 Installation and Configuration

1. Place the addon files in the corresponding folder within the server.
2. Reload the addons with the appropriate command or by restarting the server.
3. Adjust the configuration in the YAML files as needed.

### 📚 Available Addons Documentation

| Addon          | Description                 | Main Commands                         |
| -------------- | --------------------------- | ------------------------------------- |
| Vouchers       | Redeemable coupon system    | `/therewards voucher`                 |
| EventManager   | Temporary event management  | `/event start`, `/event stop`         |
| CustomCommands | Creation of custom commands | `/customcmd add`, `/customcmd remove` |

### 🔄 Addon Lifecycle

1. **Loading** - The addon initializes when the server starts
2. **Registration** - Commands, listeners, and hooks are registered
3. **Execution** - The addon responds to events and commands
4. **Unloading** - Memory is freed when the addon is deactivated

### ❓ Frequently Asked Questions

**Do addons affect server performance?** Addons are designed to have minimal impact. Each one can be activated or deactivated as needed.

**How do I create my own addon?** Check our development guide in the developers [section](https://docs.xshyo.us/free-plugins/therewards/addons), where you'll find templates and code examples.
