# Vexal Stocks

**VexalStocks** is a powerful and innovative Paper/Spigot plugin that brings **real-world stock trading** directly into your Minecraft server!\
Players can buy and sell *real stocks* using in-game money through an intuitive **GUI-based system**.\
Admins have full control over which stocks are available, and everything is automatically synced with real stock market data.

***

### ✨ Features

* 💰 **Real-world stock integration** – trade real stocks like Apple, Tesla, and more with in-game currency.
* 🧾 **Dynamic pricing** – live stock prices automatically update at intervals.
* 🪙 **Economy integration via Vault** – works with any Vault-supported economy plugin (EssentialsX, CMI, etc.).
* 🎨 **GUI-driven system** – all trading, viewing, and managing is done through clean graphical menus.
* ⚙️ **Configurable stock list** – admins can decide which stocks are available to trade.
* 📊 **Player portfolios** – track owned stocks, trade history, and value directly in-game.
* 🧠 **Easy configuration** – customize everything from update rates to GUI layout.
* 🗃 **Database support** – stores player data securely with file or MySQL backends.
* 🛠 **Developer-friendly API** – hook into VexalStocks for custom integrations.

***

### 📥 Installation

1. Download the latest version of **VexalStocks.jar** from the Releases page.
2. Drop it into your server’s `/plugins` folder.
3. Restart your server to generate configuration files.
4. Open `/plugins/VexalStocks/config.yml` and set up:
   * Stock symbols to display and trade
   * Database type (File / MySQL)
   * Update intervals
   * GUI options
   * API key for stock data (if required)
5. Reload the plugin using `/vexalstocks reload`.

***

### ⚙️ Configuration

The main configuration file is located at:

```

/plugins/VexalStocks/config.yml

```

#### Example Options:

```
update-interval: 600  # seconds between stock price refresh
stocks:
  - AAPL
  - TSLA
  - MSFT
  - NVDA
database:
  type: "mysql"
  host: "localhost"
  port: 3306
  name: "stocks"
  user: "root"
  pass: "password"
```

***

### 🔑 Commands

| Command                          | Description                           | Permission          |
| -------------------------------- | ------------------------------------- | ------------------- |
| `/stocks`                        | Opens the main stock trading GUI      | `vexalstocks.use`   |
| `/stocks view <symbol>`          | View specific stock info              | `vexalstocks.use`   |
| `/stocks buy <symbol> <amount>`  | Buy a stock                           | `vexalstocks.trade` |
| `/stocks sell <symbol> <amount>` | Sell owned stock                      | `vexalstocks.trade` |
| `/stocks reload`                 | Reload configuration                  | `vexalstocks.admin` |
| `/stocks add <symbol>`           | Add a stock to the tradable list      | `vexalstocks.admin` |
| `/stocks remove <symbol>`        | Remove a stock from the tradable list | `vexalstocks.admin` |
| `/stocks portfolio`              | View your portfolio                   | `vexalstocks.use`   |

***

### 🛡 Permissions

| Permission          | Description                                          | Default |
| ------------------- | ---------------------------------------------------- | ------- |
| `vexalstocks.use`   | Access the stock trading menu                        | true    |
| `vexalstocks.trade` | Allows buying and selling stocks                     | true    |
| `vexalstocks.admin` | Access to admin commands (reload, add/remove stocks) | op      |

***

### 🧩 Dependencies

* **Vault** (required)
* Any Vault-supported economy plugin (e.g., EssentialsX, CMI, EconomyShopGUI, etc.)
* Optional: **MySQL** for persistent player data across servers

***

### 🧠 Developer API

Developers can hook into the plugin for integrations or extensions. Basic access is provided through the `VexalStocks` API class.

Example usage:

```
VexalStocksAPI api = VexalStocks.getAPI();
double price = api.getStockPrice("AAPL");
api.buyStock(player, "AAPL", 10);
```

***

### 💬 Support & Community

Need help or want to show off your setup? Join our official Discord community:

👉 [**discord.vexalstudios.com**](https://discord.vexalstudios.com/)

***

### 🌍 Compatibility

* ✅ Paper 1.19 – 1.21.8+
* ✅ Spigot 1.19 – 1.21.8+
* ⚙️ Works with most economy and GUI plugins.

***

### 📦 Database

VexalStocks supports multiple storage backends:

* **File** (default)
* **MySQL** for multi-server setups

You can configure your preferred storage method in `config.yml`.


---

# 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://docs.vexalstudios.com/minecraft-plugins/vexal-stocks.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.
