> For the complete documentation index, see [llms.txt](https://docs.mantic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mantic.dev/manticcurrency.md).

# ManticCurrency

Mantic Development's Currency Minecraft Plugin

<figure><img src="https://2746822811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCVqlaAAAoPORtPYtxCWn%2Fuploads%2Fdq9XbvkwySef8RPtCxzr%2Fmanticcurrency.jpg?alt=media&#x26;token=eb80430d-b1db-4363-a9bf-28cb47955852" alt=""><figcaption></figcaption></figure>

🛒 [mantic.dev/product/manticcurrency](https://mantic.dev/product/manticcurrency)[ ](https://mantic.dev/product/currency)- $7.99\
🔐 Requires ManticLib (free) and supports from 1.8 upwards

**Want to change the currency name?** Simply change the command in the config.yml

#### Currency Plugin Overview

Introducing ManticCurrency, a powerful plugin that empowers server owners with the ability to create and manage their own custom currencies effortlessly. Whether you're looking to enhance your server's economy or gamify interactions, ManticCurrency offers a comprehensive suite of features to tailor your virtual economy to your liking.

#### Key Features of ManticCurrency

* **Built-in Economy & Shop** (with categories): An economy which you can change the name of!
* **Compatibility**: Works on a wide range of Minecraft versions starting from 1.8.
* **Discord Integration**: Discord Webhook logging implemented within the plugin to monitor players!
* **Daily Currency**: Incentives your players to log on daily by giving them currency!
* **Easy Setup**: Intuitive commands and a user-friendly interface make it simple to get ManticCurrency up and running.
* **MySQL, SQLITE** or JSON storage options.
* API Events for Developers: CurrencyTransactionEvent & ShopTransactionEvent

## Commands

```
» /currency help - Shows this page
» /currency top - View the top currency holders
» /currency balance - View your currency balance
» /currency balance [player] - View Player currency balance
» /currency pay [player] - Pay another player
» /currency reset [player] - Reset player currency balance
» /currency give [player] [amoumt] - Gives player currency
» /currency remove [player] [amoumt] - Remove amount from player currency
» /currency removeall - Resets all players currency balance [CONSOLE ONLY]
» /currency set [name] [amount] - Set player gems
» /currency open [name] <category> - Open the shop for another player 
» /currency convert [new type (json, mysql)] - Convert to your new database [Console Only]
» /currency reload - reloads the plugin
```

Permissions are all configurable in your config.yml

## 📸 Media

<figure><img src="https://2746822811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCVqlaAAAoPORtPYtxCWn%2Fuploads%2FfYlDG3oP1GjRG1V2U7aH%2FScreenshot%202024-02-26%20at%2022.24.50.png?alt=media&#x26;token=cb61c3dc-71e6-4954-81c2-582e4e468d75" alt=""><figcaption><p>Currency Transaction Discord Webhook Log</p></figcaption></figure>

<figure><img src="https://2746822811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCVqlaAAAoPORtPYtxCWn%2Fuploads%2F9hajvL9U8dEORCJ9scBD%2FScreenshot%202024-02-26%20at%2022.25.15.png?alt=media&#x26;token=cd57c4f5-87fb-414f-bcce-655e553b38e0" alt=""><figcaption><p>Shop Transaction Discord Webhook Log</p></figcaption></figure>

{% embed url="<https://gyazo.com/34670f33d17169fe79e6b84e70282fcb>" %}
Preview of our categories
{% endembed %}

## Shop menus and pagination

ManticCurrency has two separate menu steps: the main menu lists categories, and each category has its own product menu. The Spin Wheel’s **Rewards & Chances** menu is separate from the shop.

### Product pages in a shop category

Category files are stored in `plugins/ManticCurrency/shops/`. The `store-items` list contains the products. Set `store-item-slot-key` to one character to mark the layout slots that should be filled with products. Products are placed in the matching slots in `store-items` order. See the [Shop menus and categories guide](https://docs.mantic.dev/manticcurrency/config-files/currency-shop.yml) for the full setup steps.

For example, two rows of `x` give 18 products per page:

```yaml
store-item-slot-key: x
menu-layout:
  - 'xxxxxxxxx'
  - 'xxxxxxxxx'
  - '<##p##n##'
```

Add navigation items to the category’s `items` list. Put each button’s key in `menu-layout`, then set its action:

| Button             | Example key | Action            |
| ------------------ | ----------- | ----------------- |
| Previous page      | `p`         | `[PREVIOUS_PAGE]` |
| Next page          | `n`         | `[NEXT_PAGE]`     |
| Back to categories | `<`         | `[BACK]`          |

Each layout row must contain exactly nine characters. The number of product-slot characters sets the page size. With 18 slots, the next button appears only when the category has more than 18 products; the previous button appears after the first page. Leave `store-item-slot-key` empty to place products by their individual keys, as in the older layout style.

Create and edit categories with `/currency editor` (permission: `mantic.currency.editor`). After editing YAML files by hand, run `/currency reload`.

### Spin Wheel reward pages

The Rewards & Chances menu is configured separately in `plugins/ManticCurrency/spin_wheel.yml`. `rewards-slot-key` marks reward slots in `rewards-menu-layout`; the default layout has 36 slots per page. Keep the keys for `rewards-previous-page-item` (`<`) and `rewards-next-page-item` (`>`) in the layout. See [Config Files](https://docs.mantic.dev/manticcurrency/config-files) for how the menu files fit together.

The page buttons are connected automatically, so their `action` fields can remain empty. A next button appears only when there are more rewards than slots on one page. The default file has six sample rewards, so its first page has no next button until you add enough rewards to exceed 36. The previous button appears only after moving to a later page.

Changing the number of reward-slot characters changes how many rewards fit on a page. Keep each layout row nine characters long and make sure the previous/next item keys still appear in the layout.

### Developer API notes

`CurrencyAPI.getWalletAsync(UUID)` returns a `CompletableFuture<Wallet>` for wallet reads. Synchronous getters and mutations such as `removeBalance(...)` and `transfer(...)` wait for their result, so SQL-backed calls can take time.

`CurrencyAPI.removeBalance(UUID, amount, reason)` returns `false` for a non-positive amount or insufficient balance. `CurrencyAPI.transfer(sender, receiver, amount, reason)` returns `false` for a non-positive amount, the same sender and receiver, insufficient sender balance, or receiver-balance overflow. When API events are enabled, either method also returns `false` if its transaction event is cancelled. A `true` transfer result means both the debit and credit completed.

API balance-change events are off by default. Set `currency-api-calls-events: true` in `config.yml` to make API calls fire `CurrencyTransactionEvent`s; a transfer fires a sender `TAKE` event and receiver `GIVE` event, and cancelling either stops it. `/currency pay` fires its own `PAY` event. Handle database exceptions as well as a `false` result.
