# Phoenix Crates documentation
> Premium crates plugin for Spigot, Paper and Folia with animated 3D crates, a full in-game editor and random or selective rewards.
Docs: https://www.phoenixplugins.com/docs/phoenix-crates
Supported Minecraft versions: 1.20.4 – 26.3 (Spigot, Paper, Folia)
---
# 💎 Premium Add-ons
## Crate Claim
Stores rewards and keys for players who are offline or have a full inventory, so nothing is ever lost. Players collect them with `/crate claim`.
## Mass Opening
Lets players open several keys at once instead of one at a time, with configurable opening amounts per crate.
## Rarities
Adds rarities that you can assign to rewards, each with its own display name, colour, and effects.
## Lootboxes
Lets a crate be opened directly from a held item, without placing a crate block in the world.
## Last Winner
Tracks the most recent winner of each crate and exposes them through placeholders.
## Redis
Caches player data in Redis and keeps it in sync across a network of servers.
## Animations
Extra opening animations that you can mix with the built-in ones. Available as the Deluxe, Halloween, and Christmas animation packs.
# 🪨 Free Add-ons
## Leaderboard
Adds placeholders for a top 10 ranking of players by how many crates they have opened.
## Reward Loop
Gives a reward to every online player on a fixed timer, independent from crates and keys.
## IP Limit
Limits mass key and reward giveaways to one player per IP address, so alt accounts cannot multiply them.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/addons
---
# 🌠 Animations
## Animations
Animation add-ons add extra opening animations on top of the ones built into the plugin. Each animation registers as an independent Pre Open (Phase 1), Post Open (Phase 2), or Reward Display (Phase 3) animation, so you can mix and match them freely with the built-in ones.
They are installed like any other add-on, by dropping the JAR into the **PhoenixCrates/addons** folder. Once installed, the new animations show up in the editor under the crate's animations.
## Available Add-ons
| Add-on | Animations |
| ------ | ---------- |
| [Deluxe Animations](deluxe-animations.md) | CSGO (Vertical), Black Hole, Orbit Roulette, Astro Burst |
| [Halloween Crate Animations](halloween-crate-animations.md) | Bat, Witch, Skeleton, and Demon animations |
| [Christmas Crate Animations](christmas-crate-animations.md) | Santa Claus, Bouncing Present, Tree, and matching phases |
> **Info:**
The Lootbox add-on also ships its own animations. You can find them on the [Lootbox](../lootbox/README.md#animations) page.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/animations
---
# 🎅 Christmas Crate Animations
> **Warning:**
This is an addon for PhoenixCrates, not a plugin.
### Purchase Christmas Crate Animations from our [Website](https://www.myphoenixstore.com/en/items/christmas-crate-animations-v1)
## Installation
To install the Christmas Crate animations, make sure to drag and drop the JAR file into the **PhoenixCrates/addons** folder. Be sure to install it there; otherwise, the file won't work.
Once you have installed the JAR successfully, head over to the editor and then to the animations. From there, you will be able to configure the animations for each crate.
### Customize:
Every Christmas animation can be customized per crate. In the crate's opening animations, right-click the selected animation to open its settings. Depending on the animation you can change the items and head textures it uses, Santa's and the elf's outfit, sizes, colors, the melody and how many presents, ornaments or snowflakes it spawns. **Reset to Defaults** restores every setting of that animation.
### Animation List:
Just like the plugin's built-in animations, each Christmas animation registers as an independent Pre Open (Phase 1), Post Open (Phase 2), or Reward Display (Phase 3) animation, so you can freely mix and match any phase 1 with any phase 2 and phase 3, not only the suggested combinations below. The following list shows the combinations they were designed around:
### Combination 1:
**Phase 1**: Christmas Santa Claus
**Phase 2:** Christmas Present Cannon
**Phase 3:** Christmas Merry Cyclone
### Combination 2:
**Phase 1**: Christmas Bouncing Present
**Phase 2:** Christmas Magic Elf
**Phase 3:** Christmas Snowfall
### Combination 3:
**Phase 1**: Christmas Tree
**Phase 2:** Christmas Flying Ornaments
**Phase 3:** Christmas Essence
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/animations/christmas-crate-animations
---
# 🪙 Deluxe Animations
## CSGO (Vertical)
The **Vertical CSGO** animation will display a physical CSGO animation vertically, cycling through a few of the rewards in the crate until it stops on a single one.
**Required Version:** 1.17+ **Customizable:** No **Material:** Gunpowder
https://youtu.be/Zd6WLzsU7kI
CSGO (Verical) Animation - In Game
## Black Hole
The **Black Hole** animation summons a black hole when a crate is opened, which causes all nearby players to be pulled toward it, making it difficult for them to move away. Additionally, players within range will be affected by **potion effects** and **sounds** during the animation.
**Required Version:** 1.17+ **Customizable:** No **Material:** Black Dye
https://www.youtube.com/watch?v=vaUe-90dgkM
Black Hole Animation - In Game
> **Danger:**
The Animation above doesn't support Bedrock users, since Bedrock doesn't support Player Heads.
## Orbit Roulette
The **Orbit Roulette** animation summons items from the rewards table that rise from the ground and orbit around the crate.
**Required Version:** 1.17+ **Customizable:** No **Material:** Gold Ingot
https://www.youtube.com/watch?v=Isii-nTwKuM
Orbit Roulette Animation - In Game
## Astro Burst
The **Astro Burst** animation launches a burst of reward items from the crate into the air, similar to fireworks, before ending in an explosion effect that reveals the winning reward.
**Required Version:** 1.17+ **Customizable:** No **Material:** Wind Charge
https://www.youtube.com/watch?v=EQOkmosenQ0
Astro Burst Animation - In Game
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/animations/deluxe-animations
---
# 🎃 Halloween Crate Animations
> **Warning:**
This is an addon for PhoenixCrates, not a plugin.
## Installation
To install the **Halloween Crate Animations**, make sure to drag and drop the JAR file into the **PhoenixCrates/addons** folder. Be sure to install it there. Otherwise, the jar won't load.
Once you have installed the JAR successfully, head over to the editor and then to the animations. From there, you will be able to configure the animations for each crate.
Just like the plugin's built-in animations, each Halloween animation registers as an independent Pre Open (Phase 1), Post Open (Phase 2), or Reward Display (Phase 3) animation, so you can freely mix and match any phase 1 with any phase 2 and phase 3, not only the suggested combinations below.
## Customize
Every Halloween animation can be customized per crate. In the crate's opening animations, right-click the selected animation to open its settings. Depending on the animation you can change the items and head textures it uses, its size, its colors and how many treats, bats, ghosts or orbs it spawns. **Reset to Defaults** restores every setting of that animation.
## Bat Crate:
**Phase 1**: Bouncing Jack **Phase 2:** Bat Exodus **Phase 3:** Eerie Unveiling
https://youtu.be/WQrTRHUKGSw
Bat Animation Combination - In Game
***
## Witch Crate:
**Phase 1**: Witch Brew Boom **Phase 2:** Pumpkin Glow **Phase 3:** Pumpkin Essence
https://youtu.be/7lyaB7ereOY
Witch Animation Combination - In Game
***
## Skeleton Crate:
**Phase 1:** Haunting Vortex **Phase 2:** Spooky Ascension **Phase 3:** Dark Emanation
https://youtu.be/mxq6IwD0ngs
Skeleton Animation Combination - In Game
***
## Demon Crate:
**Phase 1**: Cauldron Madness **Phase 2:** Ghost Rise **Phase 3:** Spectral Surge
https://youtu.be/dPG7AUlWlHs
Demon Animation Combination - In Game
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/animations/halloween-crate-animations
---
# 🌐 API
> **Danger:**
The API is only available for the premium version of the plugin.
## API
Below, you’ll find information about our API. If you have any questions, feel free to contact our team.
* **Create Custom Animations** - [Click Here](custom-animations.md)
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/api
---
# 🔧 Custom Animations
> **Danger:**
The API is only available for the premium version of the plugin.
```
public class YourPhaseAnimation extends OpeningPhaseAnimation {
public YourPhaseAnimation(OpeningCrateAnimation animation, OpeningPhaseType type,
EmptyOpeningPhaseData data) {
super(animation, type, data);
}
@Override
public void load() {
}
@Override
public void tick() {
}
@Override
public void unload() {
}
}
```
```
public void onEnable() {
registerPhase(
new OpeningPhaseType(PhaseType.FIRST, "YOUR_PHASE_IDENTIFIER",
"Your Display Name",
XMaterial.STONE, ServerVersion.v1_16_R1,
new XMaterial[] {}, EmptyOpeningPhaseData.class,
(animation, type, data) -> new YourPhaseAnimationAnimation(animation,
type, (EmptyOpeningPhaseData) data),
() -> new EmptyOpeningPhaseData()));
}
public void onDisable() {
for (final OpeningPhaseType type : this.registeredPhases) {
OpeningPhaseType.unregisterPhase(type);
}
}
private void registerPhase(OpeningPhaseType phase) {
// Registering first phase animations
OpeningPhaseType.registerPhase(phase);
// Caching to unload later on
this.registeredPhases.add(phase);
}
```
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/api/custom-animations
---
# 📬 Crate Claim
## Information
The Crate Claim add-on gives every player a personal claim storage, so rewards, keys and crates handed to them while they are offline or with a full inventory are never lost.
Crate Claim - Add-On
👉 [You can purchase this add-on on Phoenix Plugins](https://www.phoenixplugins.com/product/crate-claim-addon)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition.
## Claiming
Every player gets their own storage that holds rewards, keys and lootboxes given to them while they were offline or out of inventory space. It holds an unlimited number of items, needs no permission, and players reach it with `/crate claim`.
/crate claim command
### What Changes Without It
Crate Claim is what makes a full inventory harmless. Without the add-on installed:
* A player whose inventory is full **cannot open a crate at all**. The interaction is refused with an "inventory is full" message and no key is taken.
* Keys, crates and rewards given by command are dropped at the player's feet instead, with a message telling them so.
* A physical key given to an offline player is not delivered, since there is nowhere to hold it.
With the add-on installed, all of these are stored for the player to collect later.
The win commands of a reward won with a full inventory are stored too, as one entry showing the reward's display item. Claiming it runs the commands.
### Claim All
With the claim-all feature, you can instantly claim all available rewards from the menu.
/crate claim command
### Bedrock
Bedrock players get the claim menu as a [Bedrock form](../../configurations/geysermc-bedrock.md#bedrock-forms): Claim All first, then a button per stored item. Tapping one claims it. `/crate inspectClaim` always opens the chest menu.
## Settings
The add-on adds its own entry to the editor settings, holding the three options below.
Editor
### Prioritize Inventory
Hands items straight to the player and only falls back to the claim storage when there is not enough room, so an online player with space never has to run a command to collect anything. Turning it off routes everything through the claim menu instead. On by default.
Editor > Settings > Crate Claim
### Join Reminder
Tells a player they have something waiting the moment they log in, which is what makes an offline delivery discoverable. On by default.
Editor > Settings > Crate Claim
### Automated Reminder
How long between the repeat reminders sent to players who still have unclaimed items. Only players holding something are reminded, so raising it quietens the message on a busy server without switching it off.
Editor > Settings > Crate Claim
### Admin Commands
* `/crate inspectClaim ` - Inspect another player's pending crate claims. Requires `phoenixcrates.command.inspectclaim`.
* `/crate resetClaimsAll confirm` - Permanently clears every player's pending crate claims, online and offline. This action cannot be undone. Requires `phoenixcrates.command.resetclaims`.
Without `confirm`, the command only shows a warning. The reset runs in the background with a progress bar in the action bar, or every 10% in the console, and it will not start while another task over every player's data is running. With the [Redis](../redis.md) add-on, it also clears the claims cached on the other servers of the network.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/crate-claim
---
# 📥 Claiming
## Crate Claim
Every player gets their own storage that holds rewards, keys and lootboxes given to them while they were offline or out of inventory space. It holds an unlimited number of items, needs no permission, and players reach it with `/crate claim`.
/crate claim command
## What Changes Without It
Crate Claim is what makes a full inventory harmless. Without the add-on installed:
* A player whose inventory is full **cannot open a crate at all**. The interaction is refused with an "inventory is full" message and no key is taken.
* Keys, crates and rewards given by command are dropped at the player's feet instead, with a message telling them so.
* A physical key given to an offline player is not delivered, since there is nowhere to hold it.
With the add-on installed, all of these are stored for the player to collect later.
The win commands of a reward won with a full inventory are stored too, as one entry showing the reward's display item. Claiming it runs the commands.
## Claim All
With the claim-all feature, you can instantly claim all available rewards from the menu.
/crate claim command
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/crate-claim/claiming
---
# ⚙️ Settings
## Settings
The add-on adds its own entry to the editor settings, holding the three options below.
Editor
### Prioritize Inventory
Hands items straight to the player and only falls back to the claim storage when there is not enough room, so an online player with space never has to run a command to collect anything. Turning it off routes everything through the claim menu instead. On by default.
Editor > Settings > Crate Claim
### Join Reminder
Tells a player they have something waiting the moment they log in, which is what makes an offline delivery discoverable. On by default.
Editor > Settings > Crate Claim
### Automated Reminder
How long between the repeat reminders sent to players who still have unclaimed items. Only players holding something are reminded, so raising it quietens the message on a busy server without switching it off.
Editor > Settings > Crate Claim
## Admin Commands
* `/crate inspectClaim ` - Inspect another player's pending crate claims. Requires `phoenixcrates.command.inspectclaim`.
* `/crate resetClaimsAll confirm` - Permanently clears every player's pending crate claims, online and offline. This action cannot be undone. Requires `phoenixcrates.command.resetclaims`.
Without `confirm`, the command only shows a warning. The reset runs in the background with a progress bar in the action bar, or every 10% in the console, and it will not start while another task over every player's data is running. With the [Redis](../redis.md) add-on, it also clears the claims cached on the other servers of the network.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/crate-claim/settings
---
# 🆕 Custom Addons
## Custom Addons
Custom Addons are extensions that allow users to extend, modify, or enhance the functionality of our plugin. Think of them as building blocks that enable you to tailor the behavior of the plugin, making it uniquely yours.
## Maven Dependency
```xml
nexushttps://repo.myphoenixstore.com/repository/maven-public/
```
```xml
com.phoenixplugins.sdkapi1.0-SNAPSHOT
```
### **Addon.yml File**:
* To begin customizing your plugin experience, ensure you have an "addon.yml" file in the resources of your Java project.
* Open the "addon.yml" file and configure it according to your addon's specifications.
```
name: AddonName
main: your.path.AddonExample
author: [YourName]
version: 1.0
description: Small Description (Optional)
website: Website (Optional)
```
The "addon.yml" file serves as the configuration hub for your Custom Addon, providing essential metadata such as the addon's name, main class path, author details, version, and optional description and website information.
### **Main Class**:
* Ensure that the specified `main` class in the "addon.yml" file corresponds to the path of your addon class within your project.
```java
package your.path;
import java.io.IOException;
import com.phoenixplugins.sdk.addons.Addon;
public class AddonExample extends Addon {
public AddonExample() {
// Your code here
}
@Override
public void onLoad() {
// Your code here
}
@Override
public void onEnable() {
// Your code here
}
@Override
public void onDisable() {
// Your code here
}
@Override
public String getRequiredPluginVersion() {
return "2.1.4"; // Define the main required version
}
}
```
### **Compile your Addon**:
* Compile your Custom Addon following your Java project's build instructions.
### **Install your Addon**:
* Move the compiled JAR file to the "addons" folder within the "PhoenixCrates" directory in your server plugins.
* Restart the server to apply changes and activate your Custom Addon.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/custom-addons
---
# 🌐 IP Limit
## Information
The IP Limit add-on caps how many accounts sharing the same IP address can receive keys, crates and rewards that are handed out to everyone online at once, so alt accounts cannot multiply a giveaway.
IP Limit - Add-On
👉 [You can claim this add-on for free on Phoenix Plugins](https://www.phoenixplugins.com/product/iplimit)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition.
## Limits
Everything the add-on does is reached from the IP Limit button in the main editor. Only actions that reward several players in one go are affected, so commands aimed at a single player are never filtered.
A limit of `0` is shown as Unlimited and turns the cap off for that action alone.
Editor
### Enabled
Switches the whole add-on off without uninstalling it. While it is off, every action reaches all online players regardless of the limits set below.
Editor > IP Limit
### Global Limits
The default cap for each of the four actions that can reward everyone online. Keys and crates without an override of their own use these values.
Editor > IP Limit
#### Give Key All
Caps how many accounts per IP receive a key from `/crates giveKeyAll`.
Editor > IP Limit > Global
#### Give Crate All
Caps how many accounts per IP receive a crate from `/crates giveCrateAll`.
Editor > IP Limit > Global
#### Share With Players Online
Caps how many accounts per IP receive a reward that has Share With Players Online turned on.
The player who opened the crate is filtered like everyone else, so with a limit of `1` and two of their accounts online, the reward can land on the other account instead of theirs.
Editor > IP Limit > Global
#### Reward On Loop
Caps how many accounts per IP receive a recurring reward from the [Reward On Loop](../reward-on-loop/) add-on. This one cannot be overridden per key or crate, since a loop reward belongs to neither.
Editor > IP Limit > Global
### Limit Per Key
Lists every registered key so a single one can carry its own cap instead of the Give Key All value. Keys with no override of their own are listed as inherited.
Editor > IP Limit
### Limit Per Crate
The same list for crates. A crate override replaces the Give Crate All value **and** the Share With Players Online value for that crate, so it covers both the giveaway command and rewards shared from inside it.
Editor > IP Limit
#### Limit
The cap for this key or crate on its own. It opens showing the global value it currently inherits, and setting it here creates the override.
Editor > IP Limit > Crate
#### Use Global Limit
Removes the override so the key or crate follows the global value again. This is not the same as setting the limit to `0`, which would make that one key or crate unlimited while the global cap stays in place.
Editor > IP Limit > Crate
> **Info:**
Players whose IP address cannot be read are never filtered out, so a proxy setup that hides the real address leaves the limits with nothing to match on.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/ip-limit
---
# 🚦 Limits
## IP Limit
Everything the add-on does is reached from the IP Limit button in the main editor. Only actions that reward several players in one go are affected, so commands aimed at a single player are never filtered.
A limit of `0` is shown as Unlimited and turns the cap off for that action alone.
Editor
## Enabled
Switches the whole add-on off without uninstalling it. While it is off, every action reaches all online players regardless of the limits set below.
Editor > IP Limit
## Global Limits
The default cap for each of the four actions that can reward everyone online. Keys and crates without an override of their own use these values.
Editor > IP Limit
### Give Key All
Caps how many accounts per IP receive a key from `/crates giveKeyAll`.
Editor > IP Limit > Global
### Give Crate All
Caps how many accounts per IP receive a crate from `/crates giveCrateAll`.
Editor > IP Limit > Global
### Share With Players Online
Caps how many accounts per IP receive a reward that has Share With Players Online turned on.
The player who opened the crate is filtered like everyone else, so with a limit of `1` and two of their accounts online, the reward can land on the other account instead of theirs.
Editor > IP Limit > Global
### Reward On Loop
Caps how many accounts per IP receive a recurring reward from the [Reward On Loop](../reward-on-loop/) add-on. This one cannot be overridden per key or crate, since a loop reward belongs to neither.
Editor > IP Limit > Global
## Limit Per Key
Lists every registered key so a single one can carry its own cap instead of the Give Key All value. Keys with no override of their own are listed as inherited.
Editor > IP Limit
## Limit Per Crate
The same list for crates. A crate override replaces the Give Crate All value **and** the Share With Players Online value for that crate, so it covers both the giveaway command and rewards shared from inside it.
Editor > IP Limit
### Limit
The cap for this key or crate on its own. It opens showing the global value it currently inherits, and setting it here creates the override.
Editor > IP Limit > Crate
### Use Global Limit
Removes the override so the key or crate follows the global value again. This is not the same as setting the limit to `0`, which would make that one key or crate unlimited while the global cap stays in place.
Editor > IP Limit > Crate
> **Info:**
Players whose IP address cannot be read are never filtered out, so a proxy setup that hides the real address leaves the limits with nothing to match on.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/ip-limit/limits
---
# 🛒 Key Shop
## Information
The Key Shop add-on lets players buy crate keys with a currency, and trade keys they already hold for a different kind of key. It gives a server a way to sell keys in game rather than only through a web store, and gives players something to do with the pile of common keys they never open.
Prices are charged through the same cost engines a crate uses for its open cost, so an entry can be priced in Vault money, experience levels, PlayerPoints, VotingPlugin points, ExcellentEconomy or PhoenixCurrencies without any extra setup.
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition. The currency plugin an entry is priced in has to be installed for that entry to be purchasable, but an entry priced at `0` needs nothing.
## Files
| File | What it holds |
| ---- | ------------- |
| `PhoenixCrates/key-shop.yml` | The shop entries, the exchanges and the add-on setting. |
| `PhoenixCrates/menus/default_key_shop.yml` | The layout of the shop menu. |
| `PhoenixCrates/menus/default_key_exchange.yml` | The layout of the exchange menu. |
| `PhoenixCrates/translations/keyshop.translations..yml` | The add-on messages. |
Purchase counts are stored per player in the database, in the `player_keyshop_table` table.
## Commands
* `/crate shop [player]` - Opens the key shop. Without an argument it opens for the sender.
* `/crate exchange [player]` - Opens the key exchange.
* `/crate resetKeyShop ` - Clears a player's purchase and trade counters, freeing every limit again. Requires `phoenixcrates.command.resetkeyshop`.
## Bedrock
Bedrock players get the shop and the exchange as [Bedrock forms](../../configurations/geysermc-bedrock.md#bedrock-forms): a button per entry with its price, or what it trades. Tapping an entry buys or trades it right away, or asks first when purchase confirmation is on. An entry the player cannot use shows why.
## Permissions
| Permission | What it allows |
| ---------- | -------------- |
| `phoenixcrates.command.resetkeyshop` | Resetting a player's shop limits. |
Individual entries are gated with their own `permission` option rather than a permission node.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/key-shop
---
# 🔄 Exchanges
## Exchanges
An exchange trades a number of one key for a number of another. They live under `exchanges` in key-shop.yml and are shown in their own menu.
```yaml
exchanges:
'0':
identifier: vote_to_legendary
display-item:
material: TRIPWIRE_HOOK
display-name: '&6Upgrade to Legendary'
amount: 1
from-key: vote
from-amount: 10
to-key: legendary
to-amount: 1
permission: ''
daily-limit: -1
total-limit: -1
exchange-message:
- '&aYou traded &fx%from_amount% %from_key% &afor &fx%to_amount% %to_key%&a.'
```
## Options
| Option | What it does |
| ------ | ------------ |
| `identifier` | The name the trade counters are stored under. |
| `display-item` | The item shown in the exchange menu. |
| `from-key` | The identifier of the key being spent. |
| `from-amount` | How many of it one trade consumes. |
| `to-key` | The identifier of the key being received. |
| `to-amount` | How many of it one trade gives. |
| `permission` | The player needs this to use the trade. Leave empty for everyone. |
| `daily-limit` | Trades allowed per player per day, `-1` for unlimited. |
| `total-limit` | Trades allowed per player for the lifetime of the exchange, `-1` for unlimited. |
| `exchange-message` | Sent to the player after the trade. |
## Virtual and physical keys
Both sides work with either kind of key. A virtual key is taken from the player's stored key count, and a physical key is taken from their inventory, including the off-hand slot. The key received is delivered the same way any other key is, so a physical key with a full inventory follows whatever the Crate Claim add-on is set to do.
The menu only offers a trade the player can actually complete, so an entry greys out when they are short of the key it consumes.
> **Warning:**
An exchange pointing at a key identifier that no longer exists shows as unavailable and can never be used. Renaming a key means updating every exchange that references it.
## Message placeholders
`exchange-message` accepts `%player%`, `%from_amount%`, `%from_key%`, `%to_amount%` and `%to_key%`.
## Menu placeholders
The `exchange-item` and `unavailable-item` entries in menus/default\_key\_exchange.yml accept:
| Placeholder | Value |
| ----------- | ----- |
| `%entry%` | The display name of the exchange. |
| `%item_name%` | The name of the configured display item. |
| `%from_key%` / `%from_amount%` | The key spent and how many. |
| `%to_key%` / `%to_amount%` | The key received and how many. |
| `%owned%` | How many of the spent key the player holds. |
| `%remaining%` | Trades the player has left, or the "Unlimited" label. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/key-shop/exchanges
---
# 📜 Placeholders
## PlaceholderAPI Placeholders
| Placeholder | Description |
| ----------- | ----------- |
| %phoenixcrates_keyshop_price_\% | The price of a shop entry, formatted by its cost engine. |
| %phoenixcrates_keyshop_remaining_\% | Purchases the player has left on that entry. |
| %phoenixcrates_keyshop_exchanges_\% | Trades the player has left on that exchange. |
```
%phoenixcrates_keyshop_price_vote_key_single%
%phoenixcrates_keyshop_remaining_vote_key_single%
%phoenixcrates_keyshop_exchanges_vote_to_legendary%
```
An entry with no limit reports `∞`. An identifier that does not exist reports `N/A`, which is the usual sign of a typo.
> **Info:**
The price placeholder works from the console and in contexts with no player, since a price does not depend on who is asking. The other two need an online player and report `N/A` otherwise.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/key-shop/placeholders
---
# 💰 Shop Entries
## Entries
Every offer lives under `entries` in key-shop.yml.
```yaml
confirm-purchases: false
entries:
'0':
identifier: vote_key_single
display-item:
material: TRIPWIRE_HOOK
display-name: '&aVote Key'
amount: 1
key: vote
amount: 1
cost-engine: VAULT
currency: ''
price: 2500.0
permission: ''
daily-limit: 5
total-limit: -1
purchase-commands: []
purchase-message:
- '&aYou bought &fx%amount% %key% &afor &f%price%&a.'
```
> **Info:**
Entries are stored as a numbered section rather than a YAML list, the same shape the crate rewards use. The numbers are positions only and have to stay unique inside the section.
## Options
| Option | What it does |
| ------ | ------------ |
| `identifier` | The name the purchase counters are stored under. Renaming it resets every player's limit on that entry. |
| `display-item` | The item shown in the shop menu. |
| `key` | The identifier of the key being sold. |
| `amount` | How many keys one purchase gives. |
| `cost-engine` | Which currency the price is charged in. |
| `currency` | The currency id, used only by `EXCELLENTECONOMY` and `PHOENIXCURRENCIES`. Leave empty otherwise. |
| `price` | What one purchase costs. A price of `0` is free and skips the currency check entirely. |
| `permission` | The player needs this to buy the entry. Leave empty for everyone. |
| `daily-limit` | Purchases allowed per player per day, `-1` for unlimited. |
| `total-limit` | Purchases allowed per player for the lifetime of the entry, `-1` for unlimited. |
| `purchase-commands` | Commands run by the console after a purchase. |
| `purchase-message` | Sent to the buyer. |
## Cost engines
| Engine | Requires | Notes |
| ------ | -------- | ----- |
| `NONE` | Nothing | The entry is free whatever `price` says. |
| `LEVEL` | Nothing | Charges experience levels, whole numbers only. |
| `VAULT` | Vault and an economy plugin | |
| `PLAYERPOINTS` | PlayerPoints | Whole numbers only. |
| `VOTINGPLUGIN` | VotingPlugin | Charges vote points, whole numbers only. |
| `EXCELLENTECONOMY` | ExcellentEconomy | Set `currency` to the currency id. |
| `PHOENIXCURRENCIES` | PhoenixCurrencies | Set `currency` to the currency id. |
An entry whose engine is not installed shows as unavailable in the menu rather than failing on click.
## Limits
The daily counter resets at midnight UTC, and it resets for a player who stays online across the boundary as well as one who logs in after it. Both limits apply at once, so an entry with a daily limit of `2` and a total limit of `10` allows two per day up to ten in total.
`/crate resetKeyShop ` clears both counters for that player.
## Confirmation
`confirm-purchases` at the top of the file turns every purchase into two clicks. The first click arms the entry and swaps its icon to the `confirm-item` layout, and a second click within five seconds completes the purchase. Anything else — waiting out the five seconds, or closing the menu — cancels it.
> **Info:**
The armed state lives with the open menu, so it is per player and disappears when they close the shop.
## Message placeholders
`purchase-message` accepts `%player%`, `%amount%`, `%key%`, `%entry%` and `%price%`.
`purchase-commands` accept `%player%` along with any PlaceholderAPI placeholder.
## Menu placeholders
The `entry-item`, `confirm-item` and `unavailable-item` entries in menus/default\_key\_shop.yml accept:
| Placeholder | Value |
| ----------- | ----- |
| `%entry%` | The display name of the entry. |
| `%item_name%` | The name of the configured display item. |
| `%key%` | The display name of the key being sold. |
| `%amount%` | How many keys the purchase gives. |
| `%price%` | The price, formatted by the cost engine. |
| `%remaining%` | Purchases the player has left, or the "Unlimited" label. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/key-shop/shop-entries
---
# 🏆 Last Winner
## Information
The Last Winner add-on adds placeholders to PhoenixCrates. This add-on allows you to display the last winner of a crate in various places.
Last Winner - Add-On
👉 [You can purchase this add-on on Phoenix Plugins](https://www.phoenixplugins.com/product/last-winner-addon)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition, and PlaceholderAPI for the placeholders to resolve.
## Placeholders
`` is `1` for the most recent winner, `2` for the second most recent, and so on. Up to the last **20** winners are kept per crate; requesting a position beyond that (or beyond the number of winners recorded so far) returns an empty value, as does a crate with no winners at all. `N/A` only shows for a moment while the winners of a crate are first being loaded.
Crate identifiers containing underscores, such as `fire_crate`, work as written.
| Placeholders | Description |
|-------------------------------------------------------------|-----------------------------------------------------------|
| %phoenixcrates_lastwinner_player\_\\_\% | Returns the player name on a specific position per crate. |
| %phoenixcrates_lastwinner_reward\_\\_\% | Returns the reward on a specific position per crate. |
| %phoenixcrates_lastwinner_rewardid\_\\_\% | Returns the reward's identifier on a specific position per crate. |
| %phoenixcrates_lastwinner_hour\_\\_\% | Returns the hour that the player opened the crate. |
| %phoenixcrates_lastwinner_minute\_\\_\% | Returns the minute that the player opened the crate. |
| %phoenixcrates_lastwinner_second\_\\_\% | Returns the second that the player opened the crate. |
| %phoenixcrates_lastwinner_day\_\\_\% | Returns the day that the player opened the crate. |
| %phoenixcrates_lastwinner_month\_\\_\% | Returns the month that the player opened the crate. |
| %phoenixcrates_lastwinner_year\_\\_\% | Returns the year that the player opened the crate. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/last-winner
---
# Untitled
## PlaceholderAPI Placeholders
The following is the list of the available placeholders that Last Winner has.
`` is `1` for the most recent winner, `2` for the second most recent, and so on. Up to the last **20** winners are kept per crate; requesting a position beyond that (or beyond the number of winners recorded so far) returns an empty value. A crate with no winners recorded at all returns `N/A`.
Crate identifiers containing underscores, such as `fire_crate`, work as written.
| Placeholders | Description |
|-------------------------------------------------------------|-----------------------------------------------------------|
| %phoenixcrates_lastwinner_player\_\\_\% | Returns the player name on a specific position per crate. |
| %phoenixcrates_lastwinner_reward\_\\_\% | Returns the reward on a specific position per crate. |
| %phoenixcrates_lastwinner_rewardid\_\\_\% | Returns the reward's identifier on a specific position per crate. |
| %phoenixcrates_lastwinner_hour\_\\_\% | Returns the hour that the player opened the crate. |
| %phoenixcrates_lastwinner_minute\_\\_\% | Returns the minute that the player opened the crate. |
| %phoenixcrates_lastwinner_second\_\\_\% | Returns the second that the player opened the crate. |
| %phoenixcrates_lastwinner_day\_\\_\% | Returns the day that the player opened the crate. |
| %phoenixcrates_lastwinner_month\_\\_\% | Returns the month that the player opened the crate. |
| %phoenixcrates_lastwinner_year\_\\_\% | Returns the year that the player opened the crate. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/last-winner/placeholders
---
# 🏆 Leaderboard
## Information
The Leaderboard add-on adds placeholders to PhoenixCrates, ranking players by how many crates they have opened, per crate or across every crate.
Leaderboard - Add-On
👉 [You can claim this add-on for free on Phoenix Plugins](https://www.phoenixplugins.com/product/leaderboard)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition, and PlaceholderAPI for the placeholders to resolve.
## Placeholders
The add-on ranks players by the number of crates they have opened, either for one crate or across every crate. It is entirely placeholder-driven, so there is no in-game menu.
Only the top **10** are kept, and players who have never opened that crate are left out of the ranking entirely.
A ranking is cached for 2 minutes, and opening a crate immediately invalidates both that crate's ranking and the global one, so a win is reflected on the next lookup rather than up to two minutes later.
### PlaceholderAPI Placeholders
| Placeholder | Description |
| ----------- | ----------- |
| %phoenixcrates_leaderboard_\_\% | The name of the player at that rank. |
| %phoenixcrates_leaderboard_\_\_value% | The number of crates that player has opened. |
Use `global` as the identifier to rank across every crate, or a crate's identifier to rank for that crate only. `` starts at 1. Crate identifiers containing underscores, such as `fire_crate`, work as written.
**Example:** `%phoenixcrates_leaderboard_global_1%` returns the name of the player who has opened the most crates on your server.
`N/A` is returned by a rank nobody occupies yet, by a crate identifier that does not exist, and by the first lookup of a ranking that is not cached yet, since it is built in the background. Ask again once it has been computed.
> **Info:**
`global` is reserved. A crate whose identifier is literally `global` cannot be queried through these placeholders, because the whole-server leaderboard is matched first.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/leaderboard
---
# 📜 Placeholders
## Leaderboard
The add-on ranks players by the number of crates they have opened, either for one crate or across every crate. It is entirely placeholder-driven, so there is no in-game menu.
Only the top **10** are kept, and players who have never opened that crate are left out of the ranking entirely.
A ranking is cached for 2 minutes, and opening a crate immediately invalidates both that crate's ranking and the global one, so a win is reflected on the next lookup rather than up to two minutes later.
## PlaceholderAPI Placeholders
| Placeholder | Description |
| ----------- | ----------- |
| %phoenixcrates_leaderboard_\_\% | The name of the player at that rank. |
| %phoenixcrates_leaderboard_\_\_value% | The number of crates that player has opened. |
Use `global` as the identifier to rank across every crate, or a crate's identifier to rank for that crate only. `` starts at 1. Crate identifiers containing underscores, such as `fire_crate`, work as written.
**Example:** `%phoenixcrates_leaderboard_global_1%` returns the name of the player who has opened the most crates on your server.
`N/A` is returned by a rank nobody occupies yet, by a crate identifier that does not exist, and by the first lookup of a ranking that is not cached yet, since it is built in the background. Ask again once it has been computed.
> **Info:**
`global` is reserved. A crate whose identifier is literally `global` cannot be queried through these placeholders, because the whole-server leaderboard is matched first.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/leaderboard/placeholders
---
# 🎁 Lootbox
## Information
The Lootbox add-on lets a crate be opened straight from a held item, without placing a crate block in the world, and comes with its own set of animations.
Lootbox - Add-On
👉 [You can purchase this add-on on Phoenix Plugins](https://www.phoenixplugins.com/product/lootboxes)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition.
## Opening
Formerly known as Pouches, a lootbox is a crate carried as an item and opened where the player stands. It is turned on per crate, so a server can mix lootbox crates and placed crates freely.
Editor > Crates > Crate
> **Info:**
Turning Lootbox on for a crate also turns off that crate's Key Required setting, since a lootbox is paid for with the item itself rather than a key.
### Opening Behavior
What a right-click does depends on the crate's rewards mode.
* **Random** opens the crate on the spot and takes one item from the hand straight away.
* **Selective (non RNG)** opens the reward menu first and only takes the item once a reward is confirmed. The item is looked for anywhere in the inventory at that moment, not just in the hand, and if none is left the claim is cancelled.
A configured confirmation menu is shown before any of this, exactly as it would be for a placed crate.
### Placing a Lootbox
A crate with a world animation phase needs a block for that animation to play on, so it cannot open in mid-air. The player right-clicks the ground to set the crate down, and it opens there on its own before disappearing again, which is what makes the world animation possible on a crate carried as an item.
Right-clicking the air with one of these instead tells the player to place it on the ground.
> **Info:**
Without a world animation phase, none of this applies. The crate opens directly from the hand wherever the player is standing.
> **Info:**
Holders of `phoenixcrates.admin` can sneak while placing a lootbox item to place it as an ordinary crate instead of opening it, which is how a lootbox crate is set up in the world without spending items.
### MythicItems Support
With MythicItems installed, `pcrates:crate` gives a lootbox item as a mob drop, taking the crate identifier as its argument. `pcrates:pouch` is kept as an alias so older configurations keep working.
The drop resolves to nothing at all if the crate does not exist, is disabled, or is not a lootbox, so a mistyped identifier is silently skipped rather than dropping a broken item.
## Animations
Installing the add-on adds six animations to the lists every crate picks from. They are listed with a Lootbox Addon suffix so they are easy to spot, and they work on any crate, not only lootbox ones.
| Animation | Phase |
| --------- | ----- |
| Eruption | Pre Open |
| Pulse | Pre Open |
| Arcane | Pre Open |
| Vortex | Post Open |
| Tornado | Post Open |
| Treasure Cascade | Reward Display |
Where each phase sits in an opening is covered on the [Opening Animations](../../main-features/animations/opening-animations/README.md) page.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/lootbox
---
# 🎇 Animations
## Exclusive Animations
Installing the add-on adds six animations to the lists every crate picks from. They are listed with a Lootbox Addon suffix so they are easy to spot, and they work on any crate, not only lootbox ones.
| Animation | Phase |
| --------- | ----- |
| Eruption | Pre Open |
| Pulse | Pre Open |
| Arcane | Pre Open |
| Vortex | Post Open |
| Tornado | Post Open |
| Treasure Cascade | Reward Display |
Where each phase sits in an opening is covered on the [Opening Animations](../../main-features/animations/opening-animations/README.md) page.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/lootbox/animations
---
# 🚢 Migrating from Pouches
## Migrating from Pouches
Pouches were replaced by lootboxes. Any pouches left over from that version are converted on the first server start after the add-on is installed, with no command to run, and the number converted is written to the console.
Each converted crate comes out configured the way a lootbox normally is, so Key Required and any linked keys are cleared rather than carried over.
The migration runs once. The old folder is renamed afterwards so a later restart does not convert the same crates again, which also means putting files back into a fresh pouches folder is enough to migrate more of them later.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/lootbox/migration
---
# 🖱️ Opening
## Lootbox
Formerly known as Pouches, a lootbox is a crate carried as an item and opened where the player stands. It is turned on per crate, so a server can mix lootbox crates and placed crates freely.
Editor > Crates > Crate
> **Info:**
Turning Lootbox on for a crate also turns off that crate's Key Required setting, since a lootbox is paid for with the item itself rather than a key.
## Opening Behavior
What a right-click does depends on the crate's rewards mode.
* **Random** opens the crate on the spot and takes one item from the hand straight away.
* **Selective (non RNG)** opens the reward menu first and only takes the item once a reward is confirmed. The item is looked for anywhere in the inventory at that moment, not just in the hand, and if none is left the claim is cancelled.
A configured confirmation menu is shown before any of this, exactly as it would be for a placed crate.
## Placing a Lootbox
A crate with a world animation phase needs a block for that animation to play on, so it cannot open in mid-air. The player right-clicks the ground to set the crate down, and it opens there on its own before disappearing again, which is what makes the world animation possible on a crate carried as an item.
Right-clicking the air with one of these instead tells the player to place it on the ground.
> **Info:**
Without a world animation phase, none of this applies. The crate opens directly from the hand wherever the player is standing.
> **Info:**
Holders of `phoenixcrates.admin` can sneak while placing a lootbox item to place it as an ordinary crate instead of opening it, which is how a lootbox crate is set up in the world without spending items.
## MythicItems Support
With MythicItems installed, `pcrates:crate` gives a lootbox item as a mob drop, taking the crate identifier as its argument. `pcrates:pouch` is kept as an alias so older configurations keep working.
The drop resolves to nothing at all if the crate does not exist, is disabled, or is not a lootbox, so a mistyped identifier is silently skipped rather than dropping a broken item.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/lootbox/opening
---
# 🔐 Mass Opening
## Information
The Mass Opening add-on lets players open many keys at once on a crate, instead of one opening at a time. On a keyless crate with an open cost, players pay for many openings at once instead.
Mass Opening - Add-On
👉 [You can purchase this add-on on Phoenix Plugins](https://www.phoenixplugins.com/product/mass-opening)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition.
## Crate Interaction
When the player right-clicks to open the crate, they will see a menu displaying all available mass opening options. The red glass below an option indicates that the player either doesn't have permission to use that opening or doesn't have enough keys.
**Menu:** `default_crate_mass_opening`
Crate Interaction
### Available Keys
The available keys item will display the total number of keys you have for that crate, along with a list showing the amount of each individual key.
Crate Interaction
### Paying with Money
A crate that needs no key and has an [Open Money Cost](../../main-features/crates/open-money-cost.md) uses the same menu, paid with money instead of keys. Every option shows its total cost, and an option turns red when the player cannot afford it. Choosing one opens a confirmation with the total before anything is charged, so ten openings of a $250 crate ask for $2,500 once and roll rewards ten times. The available keys item is hidden for these crates.
Shift-right-click open-all opens as many as the player can afford, up to the open-all limit, or 100 when the limit is set to all. Only the Random rewards mode supports paid mass opening.
### Selective Mode
On a crate using the Selective (non RNG) rewards mode, a player holding more than one key gets the [Mass Selection](#mass-selection) menu instead, where several rewards are picked and opened together.
### Reroll
If the reroll feature is enabled along with mass opening, a different behavior occurs when using any opening option other than the single-key opening. Instead of receiving rewards individually, the player will see a menu displaying all the rewards they’ve won. They can click on any item to reroll it. Additionally, there's a Claim All Rewards option to collect everything at once.
**Menu:** `default_crate_mass_reroll`
Crate Interaction
### Bedrock
Bedrock players get the opening options and the reroll menu as [Bedrock forms](../../configurations/geysermc-bedrock.md#bedrock-forms). An option the player cannot use shows why under its button. In the reroll form, tapping a reward rerolls it, and closing the form claims everything.
## Mass Selection
Mass selection is the Selective (non RNG) counterpart of the mass opening menu. Instead of spending one key on one reward at a time, the player picks several rewards, and how many of each, then receives all of them in a single opening.
It takes over the normal select reward menu when the crate uses Selective mode, requires a key, has mass opening enabled, and the player owns more than one key. With a single key, the regular select reward menu is used instead.
**Menu:** `default_crate_mass_selective`
> **Info:**
The opening amounts (x1, x6, x12...), the Open All option, the mass opening permissions and the global mass opening options only apply to crates in Random mode. On a selective crate the player's whole key balance is the selection limit.
### Selecting Rewards
Left-clicking a reward adds one copy to the selection, right-clicking removes one. A selected reward is swapped for the selection material and stacked to the amount picked, so the count of every choice stays visible while browsing.
The total number of selections is capped by the keys the player currently owns. Once the cap is reached, the remaining rewards gain an extra lore line and clicking them sends a message instead of selecting.
Rewards the player cannot obtain at that moment, because of a missing permission, a reached win limit or a win cooldown, are shown as locked and cannot be selected. Disabled rewards and rewards past their time limit are not listed at all.
### Rarity Groups
Rewards belonging to a rarity with [Group Rewards](../rarity/reward-rarity.md#reward-groups) enabled are collapsed into a single category icon. Clicking it opens the same menu filtered to that rarity, where the player selects normally, and closing it returns to the full list. Selections made inside a category are kept, so the cap and the confirm item always count every choice across all categories.
### Confirming
The confirm item shows how many rewards are selected against the keys available. Confirming consumes one key per selected reward and opens all of them in one crate opening. The Required Keys value of a reward, or of its rarity, is not applied here: every selection costs exactly one key.
Rerolling is always skipped for a mass selection opening, even when reroll is enabled on the crate.
Bedrock players pick their rewards with one slider per reward, rarity groups included, and submit to open them. Locked rewards are listed without a slider.
### Customization
The menu has its own items and options on top of the usual settings, pagination and items:
| Option | Description |
| ----------------------- | --------------------------------------------------------------------------------- |
| Confirm | The item that validates the selection and opens the crate. |
| Reward Item | Name and lore applied on top of each selectable reward. |
| Locked Reward Item | Name and lore used for rewards the player cannot obtain. |
| Selected Material | The material a reward is replaced with once selected. |
| Sounds | The sounds played when selecting, unselecting, and when an action is not allowed. |
| Max Selections Lore | Extra lore added to the rewards that can no longer be selected. |
| Max Selections Message | The message sent when clicking a reward past the selection cap. |
The following placeholders are available in this menu:
| Placeholder | Description |
| -------------------- | -------------------------------------------------- |
| `%total_selections%` | Total amount of rewards currently selected. |
| `%available_keys%` | Amount of keys the player owns for that crate. |
| `%selected_amount%` | Amount selected of that specific reward. |
| `%reward_name%` | Display name of the reward. |
| `%reward_lore%` | Lore of the reward. |
## Settings
With mass opening, players are able to open many keys simultaneously and obtain rewards. It is turned on per crate through its own menu, and starts out disabled.
Editor > Crates > Crate
### Opening Settings
There are six opening options, all configurable except the single-key one, defaulting to x1, x6, x12, x32, x64 and x100. The largest can also be set to consume every key the player holds.
Each option can be turned off on its own, and the amounts have to stay in ascending order, so an option can never be raised past the next one. Disabling every option turns mass opening off for that crate.
> **Info:**
The Open All maximum cannot be set below the highest opening option. Lowering it past that value snaps it back up, which can look like the setting is not saving. Lower the option above it first.
The opening options apply to crates in Random mode. A selective crate uses the [Mass Selection](#mass-selection) menu instead, where the key balance is the only limit.
Editor > Crates > Crate > Mass Opening
### Global Settings
These apply to every crate at once rather than to one crate, and all three only affect crates in Random mode. They sit under the add-on's own entry in the editor settings.
Editor
#### Skip Single Key Menu
Sends a player straight into the opening when they only hold one key, since a menu offering a single choice has nothing to decide. On by default.
Editor > Settings > Mass Opening
#### Shift Right-Click Open All
Gives players a shortcut past the menu entirely, spending every key they hold in one interaction. On a [paid crate](#paying-with-money) it opens as many as the player can afford instead, after a confirmation. Off by default, and it still respects the Open All permission.
Editor > Settings > Mass Opening
#### Toggle Mass Opening Menu
Suppresses the mass opening menu on every crate in Random mode, including crates paid with money, so interacting opens one at a time as though the add-on were not installed. Useful for turning mass opening off server-wide without touching each crate.
> **Info:**
This toggle does not reach crates in Selective mode. A player holding more than one key still gets the [Mass Selection](#mass-selection) menu there.
Editor > Settings > Mass Opening
## Permissions
Each opening option above the first is gated separately, so a server can sell larger openings by rank. An option the player has no permission for is shown greyed out rather than hidden.
| Permission | Description |
| -------------------------- | ----------------------------------------------- |
| phoenixcrates.massopen.1 | Gives access to the 2nd opening of a crate |
| phoenixcrates.massopen.2 | Gives access to the 3rd opening of a crate |
| phoenixcrates.massopen.3 | Gives access to the 4th opening of a crate |
| phoenixcrates.massopen.4 | Gives access to the 5th opening of a crate |
| phoenixcrates.massopen.all | Gives access to the Open All opening of a crate |
| phoenixcrates.massopen.\* | Gives access to all the openings |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/mass-opening
---
# 👆 Crate Interaction
## Crate Interaction
When the player right-clicks to open the crate, they will see a menu displaying all available mass opening options. The red glass below an option indicates that the player either doesn't have permission to use that opening or doesn't have enough keys.
**Menu:** `default_crate_mass_opening`
Crate Interaction
## Available Keys
The available keys item will display the total number of keys you have for that crate, along with a list showing the amount of each individual key.
Crate Interaction
## Paying with Money
A crate that needs no key and has an [Open Money Cost](../../main-features/crates/open-money-cost.md) uses the same menu, paid with money instead of keys. Every option shows its total cost, and an option turns red when the player cannot afford it. Choosing one opens a confirmation with the total before anything is charged, so ten openings of a $250 crate ask for $2,500 once and roll rewards ten times. The available keys item is hidden for these crates.
Shift-right-click open-all opens as many as the player can afford, up to the open-all limit, or 100 when the limit is set to all. Only the Random rewards mode supports paid mass opening.
## Selective Mode
On a crate using the Selective (non RNG) rewards mode, a player holding more than one key gets the [Mass Selection](mass-selection.md) menu instead, where several rewards are picked and opened together.
## Reroll
If the reroll feature is enabled along with mass opening, a different behavior occurs when using any opening option other than the single-key opening. Instead of receiving rewards individually, the player will see a menu displaying all the rewards they’ve won. They can click on any item to reroll it. Additionally, there's a Claim All Rewards option to collect everything at once.
**Menu:** `default_crate_mass_reroll`
Crate Interaction
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/mass-opening/crate-interaction
---
# 🧺 Mass Selection
## Mass Selection
Mass selection is the Selective (non RNG) counterpart of the mass opening menu. Instead of spending one key on one reward at a time, the player picks several rewards, and how many of each, then receives all of them in a single opening.
It takes over the normal select reward menu when the crate uses Selective mode, requires a key, has mass opening enabled, and the player owns more than one key. With a single key, the regular select reward menu is used instead.
**Menu:** `default_crate_mass_selective`
> **Info:**
The opening amounts (x1, x6, x12...), the Open All option, the mass opening permissions and the global mass opening options only apply to crates in Random mode. On a selective crate the player's whole key balance is the selection limit.
## Selecting Rewards
Left-clicking a reward adds one copy to the selection, right-clicking removes one. A selected reward is swapped for the selection material and stacked to the amount picked, so the count of every choice stays visible while browsing.
The total number of selections is capped by the keys the player currently owns. Once the cap is reached, the remaining rewards gain an extra lore line and clicking them sends a message instead of selecting.
Rewards the player cannot obtain at that moment, because of a missing permission, a reached win limit or a win cooldown, are shown as locked and cannot be selected. Disabled rewards and rewards past their time limit are not listed at all.
## Rarity Groups
Rewards belonging to a rarity with [Group Rewards](../rarity/reward-groups.md) enabled are collapsed into a single category icon. Clicking it opens the same menu filtered to that rarity, where the player selects normally, and closing it returns to the full list. Selections made inside a category are kept, so the cap and the confirm item always count every choice across all categories.
## Confirming
The confirm item shows how many rewards are selected against the keys available. Confirming consumes one key per selected reward and opens all of them in one crate opening. The Required Keys value of a reward, or of its rarity, is not applied here: every selection costs exactly one key.
Rerolling is always skipped for a mass selection opening, even when reroll is enabled on the crate.
## Customization
The menu has its own items and options on top of the usual settings, pagination and items:
| Option | Description |
| ----------------------- | --------------------------------------------------------------------------------- |
| Confirm | The item that validates the selection and opens the crate. |
| Reward Item | Name and lore applied on top of each selectable reward. |
| Locked Reward Item | Name and lore used for rewards the player cannot obtain. |
| Selected Material | The material a reward is replaced with once selected. |
| Sounds | The sounds played when selecting, unselecting, and when an action is not allowed. |
| Max Selections Lore | Extra lore added to the rewards that can no longer be selected. |
| Max Selections Message | The message sent when clicking a reward past the selection cap. |
The following placeholders are available in this menu:
| Placeholder | Description |
| -------------------- | -------------------------------------------------- |
| `%total_selections%` | Total amount of rewards currently selected. |
| `%available_keys%` | Amount of keys the player owns for that crate. |
| `%selected_amount%` | Amount selected of that specific reward. |
| `%reward_name%` | Display name of the reward. |
| `%reward_lore%` | Lore of the reward. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/mass-opening/mass-selection
---
# 🔒 Permissions
## Permissions
Each opening option above the first is gated separately, so a server can sell larger openings by rank. An option the player has no permission for is shown greyed out rather than hidden.
| Permission | Description |
| -------------------------- | ----------------------------------------------- |
| phoenixcrates.massopen.1 | Gives access to the 2nd opening of a crate |
| phoenixcrates.massopen.2 | Gives access to the 3rd opening of a crate |
| phoenixcrates.massopen.3 | Gives access to the 4th opening of a crate |
| phoenixcrates.massopen.4 | Gives access to the 5th opening of a crate |
| phoenixcrates.massopen.all | Gives access to the Open All opening of a crate |
| phoenixcrates.massopen.\* | Gives access to all the openings |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/mass-opening/permissions
---
# ⚙️ Settings
## Mass Opening
With mass opening, players are able to open many keys simultaneously and obtain rewards. It is turned on per crate through its own menu, and starts out disabled.
Editor > Crates > Crate
## Opening Settings
There are six opening options, all configurable except the single-key one, defaulting to x1, x6, x12, x32, x64 and x100. The largest can also be set to consume every key the player holds.
Each option can be turned off on its own, and the amounts have to stay in ascending order, so an option can never be raised past the next one. Disabling every option turns mass opening off for that crate.
> **Info:**
The Open All maximum cannot be set below the highest opening option. Lowering it past that value snaps it back up, which can look like the setting is not saving. Lower the option above it first.
The opening options apply to crates in Random mode. A selective crate uses the [Mass Selection](mass-selection.md) menu instead, where the key balance is the only limit.
Editor > Crates > Crate > Mass Opening
## Global Settings
These apply to every crate at once rather than to one crate, and all three only affect crates in Random mode. They sit under the add-on's own entry in the editor settings.
Editor
### Skip Single Key Menu
Sends a player straight into the opening when they only hold one key, since a menu offering a single choice has nothing to decide. On by default.
Editor > Settings > Mass Opening
### Shift Right-Click Open All
Gives players a shortcut past the menu entirely, spending every key they hold in one interaction. On a [paid crate](crate-interaction.md#paying-with-money) it opens as many as the player can afford instead, after a confirmation. Off by default, and it still respects the Open All permission.
Editor > Settings > Mass Opening
### Toggle Mass Opening Menu
Suppresses the menu for every crate, so interacting opens one key at a time as though the add-on were not installed. Useful for turning mass opening off server-wide without touching each crate.
Editor > Settings > Mass Opening
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/mass-opening/settings
---
# 🏅 Milestones
## Information
The Milestones add-on rewards a player for the number of crates they have opened, turning a long grind into a set of visible goals. A milestone can watch one crate or every crate at once, and its reward can be handed over automatically or left in a menu for the player to claim.
Progress is read from the openings the plugin already records on each player, so installing the add-on does not reset or re-count anything. A player who has already opened 400 crates arrives with that progress intact.
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition. PlaceholderAPI is only needed for the progress placeholders, the milestones themselves work without it.
## Files
| File | What it holds |
| ---- | ------------- |
| `PhoenixCrates/milestones.yml` | The milestone tiers and the two add-on settings. |
| `PhoenixCrates/menus/default_crate_milestones.yml` | The layout of the milestones menu. |
| `PhoenixCrates/translations/milestones.translations..yml` | The add-on messages. |
The claimed tiers are stored per player in the database, in the `player_milestones_table` table, so they follow the player across every server sharing that database.
## Bedrock
Bedrock players get the milestones menu as a [Bedrock form](../../configurations/geysermc-bedrock.md#bedrock-forms): a button per tier with its progress. Tapping an unlocked tier claims it, any other tier shows its description.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/milestones
---
# 🎯 Milestones
## Tiers
Every tier lives under `milestones` in milestones.yml. A tier is unlocked once the player's opening count on its track reaches `required-openings`.
```yaml
milestones:
'0':
identifier: first_steps
display-item:
material: DIAMOND
display-name: '&aFirst Steps'
amount: 1
crate: '*'
required-openings: 10
win-items: {}
win-commands:
- 'crate giveKey vote %player% 3'
win-message:
- '&aYou reached the &f%milestone%&a milestone!'
broadcast-message:
- '&e%player% &areached the &f%milestone%&a milestone!'
required-permissions: []
auto-claim: false
broadcast: false
max-win-item-amount: -1
max-win-command-amount: -1
```
> **Info:**
Tiers are stored as a numbered section rather than a YAML list, which is the same shape the crate rewards use. The numbers are positions only, so they have to stay unique inside the section, and reordering them changes the order shown in the menu but nothing else.
## Options
| Option | What it does |
| ------ | ------------ |
| `identifier` | The name the tier is stored under. Renaming it makes every player able to claim the tier again, so treat it as permanent. |
| `display-item` | The item shown in the milestones menu. |
| `crate` | Which openings are counted. A crate identifier counts only that crate; `*` counts every crate together. |
| `required-openings` | How many openings unlock the tier. |
| `win-items` | Items handed to the player. |
| `win-commands` | Commands run when the tier is claimed. Prefix a command with `*` to run it as the player instead of the console. |
| `win-message` | Sent to the player who claimed the tier. |
| `broadcast-message` | Sent to every online player, only when `broadcast` is on. |
| `required-permissions` | The player needs at least one of these to see or claim the tier. Leave empty for everyone. |
| `auto-claim` | Hands the reward over the moment the tier unlocks instead of waiting for a click. |
| `broadcast` | Announces the tier to the whole server. |
| `max-win-item-amount` | How many of the win items are given, `-1` for all of them. |
| `max-win-command-amount` | How many of the win commands are run, `-1` for all of them. |
## Tracks
Tiers are grouped by the crate they watch, and each group runs its own ladder. A tier on `vote` and a tier on `*` are on separate ladders, so a player can be part way through both at once.
The menu lists every tier in ascending order of `required-openings`, whichever track it belongs to.
> **Info:**
`crate` is matched against the crate identifier, not its display name. A tier pointing at a crate that no longer exists simply never unlocks.
## Message placeholders
`win-message` and `broadcast-message` accept:
| Placeholder | Value |
| ----------- | ----- |
| `%player%` | The player who claimed the tier. |
| `%milestone%` | The display name of the tier. |
| `%openings%` | The tier's `required-openings`. |
## Menu placeholders
The `locked-milestone`, `claimable-milestone` and `claimed-milestone` entries in menus/default\_crate\_milestones.yml accept:
| Placeholder | Value |
| ----------- | ----- |
| `%milestone%` | The display name of the tier. |
| `%item_name%` | The name of the configured display item. |
| `%progress%` | Openings on this track, capped at the requirement. |
| `%total_progress%` | Openings on this track, uncapped. |
| `%required%` | Openings needed to unlock the tier. |
| `%percent%` | Progress as a whole number out of 100. |
| `%crate%` | The crate identifier, or the "Any Crate" label for a `*` tier. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/milestones/milestones
---
# 📜 Placeholders
## PlaceholderAPI Placeholders
| Placeholder | Description |
| ----------- | ----------- |
| %phoenixcrates_milestones_claimed% | How many tiers the player has claimed. |
| %phoenixcrates_milestones_pending% | How many unlocked tiers are waiting to be claimed. |
| %phoenixcrates_milestones_progress_\% | The player's openings on that track. |
| %phoenixcrates_milestones_next_\% | The display name of the next unclaimed tier on that track. |
| %phoenixcrates_milestones_remaining_\% | Openings still needed to unlock that tier. |
The three track placeholders take a crate identifier. Use `*` to read the "any crate" track.
```
%phoenixcrates_milestones_next_vote%
%phoenixcrates_milestones_remaining_*%
```
A track whose tiers have all been claimed reports `-` for `next` and `0` for `remaining`, so a scoreboard line can be left in place once a player finishes the ladder.
> **Info:**
A player whose crate data has not finished loading reports `N/A` rather than a wrong number. Seeing it briefly on login is expected.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/milestones/placeholders
---
# ⚙️ Settings
## Settings
Both settings sit at the top of milestones.yml.
### claim-retroactively
Decides what happens to the tiers a player had already passed before the add-on was installed. On by default, those tiers are offered as normal, which is what you want on a new setup.
Turned off, the tiers a player has already passed are written off once, silently, the first time their milestones are evaluated. Only the tiers they cross from that point on pay out. This is the setting to use when adding milestones to an established server, where the default would hand a veteran player every tier at once.
> **Warning:**
The write-off happens per player and cannot be undone by turning the setting back on. Decide before the add-on goes live on a server with existing players.
### notify-on-join
Tells a player shortly after they log in how many rewards are waiting to be claimed. Only players with something pending are messaged. On by default.
## Commands
* `/crate milestones [player]` - Opens the milestones menu. Without an argument it opens for the sender.
* `/crate resetMilestones ` - Clears the tiers a player has claimed, letting them claim every unlocked tier again. Requires `phoenixcrates.command.resetmilestones`.
## Permissions
| Permission | What it allows |
| ---------- | -------------- |
| `phoenixcrates.command.resetmilestones` | Resetting a player's claimed milestones. |
Individual tiers are gated with their own `required-permissions` list rather than a permission node, so a rank-only milestone is configured on the tier itself.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/milestones/settings
---
# 💍 Rarity
## Information
The Rarity add-on adds categories to PhoenixCrates. Rarities are attached to rewards to synchronize their drop rates, or to keys to guarantee a reward of a specific rarity.
Rarities - Add-On
👉 [You can purchase this add-on on Phoenix Plugins](https://www.phoenixplugins.com/product/rarities-addon)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition.
## Rarities
### Create a Rarity
Rarities have their own category in the editor, where they are created and managed. Clicking the stained glass adds a new one.
Editor > Rarities
Every rarity already created is listed there with its identifier, and opening one leads to its own settings.
Editor > Rarities
A rarity is attached to rewards on [Reward Rarity](reward-rarity.md) and to keys with [Guarantee Rarity Reward](../../main-features/keys/README.md#guarantee-rarity-reward).
## Edit Rarity
### Identifier
With this option, you can set an identifier for the rarity. Note that the rarity identifier is unique and used internally by the plugin, and its different from the display name.
Editor > Rarities > Rarity
> **Danger:**
If the identifier is changed, all rarities associated with the rewards/keys will no longer work.
### Display Name
With this option, you can adjust the display name of the rarity. The display name is typically shown in the reward/key lore.
For the display name, you can use the default Minecraft color codes. For hex colors, use the \D6D045 format.
Editor > Rarities > Rarity
### Enabled
With this option, you can disable the rarity. It stays attached to its rewards and keys, but those rewards can no longer be won and their lore shows Not set in place of the rarity name.
Editor > Rarities > Rarity
### Group Rewards
With this option, every reward carrying this rarity is collapsed into a single category icon in the rewards preview, the select reward menu and the mass selection menu, instead of being listed one by one. The category and the item representing it are covered in [Reward Groups](reward-rarity.md#reward-groups).
Editor > Rarities > Rarity
### Delete Rarity
This option allows you to permanently delete a rarity. Note that selecting it will first open a confirmation menu before the rarity is deleted. Additionally, the rarity will still be attached to a reward/key.
Editor > Rarities > Rarity
> **Danger:**
This option is permanent, and rewards can't be restored.
## Misc Options
### Rarity Weight
With this, you can set a weight value for the rarity (default `100`). Every reward attached to that rarity has its own individual chance weight multiplied by `rarity weight / 100` before the crate's normal chance calculation runs, so a higher rarity weight makes every reward under it proportionally more likely to be picked, and a lower weight makes them rarer, without having to edit each reward's chance individually. It is not a percentage and does not reserve a share of the draw.
Editor > Rarities > Rarity
> **Info:**
If a rarity is disabled, every reward attached to it becomes impossible to win (effective weight `0`) until the rarity is re-enabled.
### Required Keys
With this, you can set how many keys are required to redeem a reward of this rarity when the crate uses the Selective (non RNG) rewards mode (default `1`). Once a rarity is assigned to a reward, this value overrides that reward's own individual Required Keys setting.
Editor > Rarities > Rarity
### Opening Animation
With this, you can pick a second phase animation for the rarity. When the reward drawn from a crate has this rarity, its animation plays instead of the crate's own second phase. Leaving it on Crate Default keeps the crate's animation.
Rarity (Opening Animation)
The override only applies when the rarity's animation runs in the same place as the crate's: a GUI animation can replace a GUI one and a world animation a world one. Otherwise the crate's animation plays. When one opening draws several rewards, the first one decides. Only GUI animations and world animations without settings of their own can be picked.
### Win Actions
With this, you can set actions that run when a reward of this rarity is won, such as a sound or a broadcast for a legendary drop. They replace the crate's and the global On Win actions, and a reward with its own win actions still uses those instead. The placeholders and how one opening with several rewards is handled are covered in [Event Actions](../../main-features/crates/README.md#event-actions).
Rarity (Win Actions)
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/rarity
---
# 🎟️ Edit Rarity
## Identifier
With this option, you can set an identifier for the rarity. Note that the rarity identifier is unique and used internally by the plugin, and its different from the display name.
Editor > Rarities > Rarity
> **Danger:**
If the identifier is changed, all rarities associated with the rewards/keys will no longer work.
## Display Name
With this option, you can adjust the display name of the rarity. The display name is typically shown in the reward/key lore.
For the display name, you can use the default Minecraft color codes. For hex colors, use the \D6D045 format.
Editor > Rarities > Rarity
## Enabled
With this option, you can disable the rarity. The rarity will remain to the key and rewards, but only as a display name for their lore.
Editor > Rarities > Rarity
## Group Rewards
With this option, every reward carrying this rarity is collapsed into a single category icon in the rewards preview, the select reward menu and the mass selection menu, instead of being listed one by one. The category and the item representing it are covered in [Reward Groups](reward-groups.md).
Editor > Rarities > Rarity
## Delete Rarity
This option allows you to permanently delete a rarity. Note that selecting it will first open a confirmation menu before the key is deleted. Additionally, the rarity will still be attached to a reward/key.
Editor > Rarities > Rarity
> **Danger:**
This option is permanent, and rewards can't be restored.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/rarity/edit-rarity
---
# 📈 Misc Options
## Rarity Weight
With this, you can set a weight value for the rarity (default `100`). Every reward attached to that rarity has its own individual chance weight multiplied by `rarity weight / 100` before the crate's normal chance calculation runs, so a higher rarity weight makes every reward under it proportionally more likely to be picked, and a lower weight makes them rarer, without having to edit each reward's chance individually. It is not a percentage and does not reserve a share of the draw.
Editor > Rarities > Rarity
> **Info:**
If a rarity is disabled, every reward attached to it becomes impossible to win (effective weight `0`) until the rarity is re-enabled.
## Required Keys
With this, you can set how many keys are required to redeem a reward of this rarity when the crate uses the Selective (non RNG) rewards mode (default `1`). Once a rarity is assigned to a reward, this value overrides that reward's own individual Required Keys setting.
Editor > Rarities > Rarity
## Opening Animation
With this, you can pick a second phase animation for the rarity. When the reward drawn from a crate has this rarity, its animation plays instead of the crate's own second phase. Leaving it on Crate Default keeps the crate's animation.
Rarity (Opening Animation)
The override only applies when the rarity's animation runs in the same place as the crate's: a GUI animation can replace a GUI one and a world animation a world one. Otherwise the crate's animation plays. When one opening draws several rewards, the first one decides. Only GUI animations and world animations without settings of their own can be picked.
## Win Actions
With this, you can set actions that run when a reward of this rarity is won, such as a sound or a broadcast for a legendary drop. They replace the crate's and the global On Win actions, and a reward with its own win actions still uses those instead. The placeholders and how one opening with several rewards is handled are covered in [Event Actions](../../main-features/crates/misc-options.md#event-actions).
Rarity (Win Actions)
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/rarity/misc-options
---
# 💍 Rarities
## Create a Rarity
Rarities have their own category in the editor, where they are created and managed. Clicking the stained glass adds a new one.
Editor > Rarities
Every rarity already created is listed there with its identifier, and opening one leads to its own settings.
Editor > Rarities
## Navigation
From here, you can quickly navigate to a specific feature related to rarities.
| Feature | Description |
| ------------------------------------------------------------------------------------- | --------------------------------------- |
| [Identifier](edit-rarity.md#identifier) | Set a unique ID for your rarity. |
| [Display Name](edit-rarity.md#display-name) | Change the display name for the rarity. |
| [Weight](misc-options.md#rarity-weight) | Set the chance weight for the rarity. |
| [Required Keys](misc-options.md#required-keys) | Set how many keys are needed to redeem a reward of this rarity in Selective mode. |
| [Opening Animation](misc-options.md#opening-animation) | Play a different second phase animation for this rarity. |
| [Win Actions](misc-options.md#win-actions) | Run actions when a reward of this rarity is won. |
| [Enabled](edit-rarity.md#enabled) | Swap the status of the rarity. |
| [Group Rewards](edit-rarity.md#group-rewards) | Collapse every reward of this rarity into one category. |
| [Display Item](reward-groups.md#display-item) | Customize the item representing the category. |
| [Preview Menu](reward-groups.md#preview-menu) | Override the menu used when previewing a category. |
| [Delete Rarity](edit-rarity.md#delete-rarity) | Quick delete the rarity. |
| [Reward Rarity](reward-rarity.md) | Assign a Rarity to a Reward. |
| [Key Rarity](../../main-features/keys/edit-key.md#guarantee-rarity-reward) | Assign a Rarity to a Key. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/rarity/rarities
---
# 🗂️ Reward Groups
## Reward Groups
A rarity with [Group Rewards](edit-rarity.md#group-rewards) enabled collapses every reward carrying it into one category icon instead of listing them one by one. Players open the category to browse or pick from it, which keeps crates with a long reward list readable.
Rewards without a grouped rarity keep their own slot and are listed after the categories. A rarity that is disabled never groups, its rewards go back to being listed individually.
Editor > Crates > Crate > Rewards
Opening a category lists the rewards it holds, each one editable from there like any other reward.
Editor > Crates > Crate > Rewards > Category
## Where Groups Appear
| Menu | Behaviour |
| ------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Rewards Preview | The category opens a preview filtered to that rarity. |
| Select Reward | The category opens the rewards of that rarity to choose from. |
| [Mass Selection](../mass-opening/mass-selection.md) | The category opens a filtered selection shared with the main menu. |
| Editor > Crates > Crate > Rewards | The category opens its settings and the rewards it contains. |
## Display Item
By default a category is shown as a chest named after the rarity, with the number of rewards it contains in the lore. Opening the category from the crate reward list in the editor gives access to its settings, where the icon can be replaced with any item and given a custom display name and lore, both supporting MiniMessage.
An Item Properties sub-menu goes further: RGB color, item flags, banner patterns, enchantments, model data and item model, enchantment glint override, potion effects, armor trim, and tooltip style.
Editor > Crates > Crate > Rewards > Category
## Preview Menu
Clicking a category in the rewards preview opens the crate's own preview menu, filtered to that rarity. With this option you can point a category at a different preview menu instead, which is useful to give a rarity its own title, size or decoration. Leaving it unset keeps the crate's preview menu.
Editor > Crates > Crate > Rewards > Category
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/rarity/reward-groups
---
# 🥇 Reward Rarity
By assigning a rarity to your rewards, you can easily organize them across different crates.
Editor > Crates > Crate > Rewards > Reward
## Rarity Display
When you select a rarity for your reward, its rarity is used to compute the reward's actual win chance (via the rarity's [Weight](README.md#rarity-weight)), and the rarity's display name becomes available in the reward's lore through the `%rarity_name%` placeholder. Since the chance calculation already accounts for the rarity's weight, the reward's displayed percentage always reflects the rarity automatically, without needing a separate sync toggle.
If the rarity has [Required Keys](README.md#required-keys) set, it also overrides the reward's own Required Keys value when the crate uses Selective (non RNG) mode.
Editor > Crates > Crate > Rewards
Editor > Crates > Crate > Rewards > Reward
## Reward Groups
A rarity with [Group Rewards](README.md#group-rewards) enabled collapses every reward carrying it into one category icon instead of listing them one by one. Players open the category to browse or pick from it, which keeps crates with a long reward list readable.
Rewards without a grouped rarity keep their own slot and are listed after the categories. A rarity that is disabled never groups, its rewards go back to being listed individually.
Editor > Crates > Crate > Rewards
Opening a category lists the rewards it holds, each one editable from there like any other reward.
Editor > Crates > Crate > Rewards > Category
### Where Groups Appear
| Menu | Behaviour |
| ------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Rewards Preview | The category opens a preview filtered to that rarity. |
| Select Reward | The category opens the rewards of that rarity to choose from. |
| [Mass Selection](../mass-opening/README.md#mass-selection) | The category opens a filtered selection shared with the main menu. |
| Editor > Crates > Crate > Rewards | The category opens its settings and the rewards it contains. |
### Display Item
By default a category is shown as a chest named after the rarity, with the number of rewards it contains in the lore. Opening the category from the crate reward list in the editor gives access to its settings, where the icon can be replaced with any item and given a custom display name and lore, both supporting MiniMessage.
An Item Properties sub-menu goes further: RGB color, item flags, banner patterns, enchantments, model data and item model, enchantment glint override, potion effects, armor trim, and tooltip style.
Editor > Crates > Crate > Rewards > Category
### Preview Menu
Clicking a category in the rewards preview opens the crate's own preview menu, filtered to that rarity. With this option you can point a category at a different preview menu instead, which is useful to give a rarity its own title, size or decoration. Leaving it unset keeps the crate's preview menu.
Editor > Crates > Crate > Rewards > Category
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/rarity/reward-rarity
---
# 🗄️ Redis
## Information
The Redis add-on caches player data in Redis and keeps it in sync across a network of servers, so keys, cooldowns and win limits stay consistent as players move between them.
👉 [You can purchase this add-on on Phoenix Plugins](https://www.phoenixplugins.com/)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
## Redis
Redis sits in front of your database, it does not replace it.
On the first start it generates a `redis.yml` file in the plugin's folder, where you set your connection details.
> **Warning:**
You still need MySQL configured. Redis is only the cache and locking layer, all data is still written to the database.
## Player Locking
While a server is handling a player, it holds a lock on that player in Redis so no other server can write their data at the same time. The lock is refreshed for as long as the player is online, and released when they leave or when the server shuts down.
If a lock cannot be obtained in time, the change is written straight to the database instead, so no rewards or keys are lost.
## Cross-Server Messaging
Servers connected to the same Redis with the same key prefix send each other messages, so an action taken on one server reaches the rest of the network. Resetting every [Crate Claim](crate-claim/README.md#admin-commands), for example, also clears the claims cached on the other servers. Messaging is enabled by default.
If the messaging connection drops, the server keeps retrying on its own until it is restored.
## Settings
| Setting | Description |
| ------- | ----------- |
| Host / Port / Password / Database | The connection details of your Redis server. |
| Connection Pool | The maximum, idle, and minimum number of connections kept open. Default is `8`, `8`, and `0`. |
| Key Prefix | The prefix used for every key the add-on writes and for its messaging channel. Networks sharing one Redis server stay apart, with separate player data, locks and messages, as long as each uses its own prefix. Default is `phoenixcrates`. |
| Data TTL | How long, in seconds, cached player data is kept. Default is `3600`. |
| Lock TTL | How long, in seconds, a player lock stays valid without a refresh. Default is `15`. |
| Heartbeat Interval | How often, in seconds, held locks are refreshed. Default is `5`. |
| Lock Poll Interval | How often, in milliseconds, a server retries while waiting for a lock. Default is `200`. |
| Max Lock Wait | How long, in milliseconds, to keep waiting for a lock before giving up and writing straight to the database. Default is `15000`. |
| Messaging | Turns cross-server messaging on or off. Enabled by default. |
| Messaging Channel | The channel servers talk over, placed after the key prefix. Default is `messages`. |
| Reconnect Delay | How long, in seconds, to wait before retrying a lost messaging connection. Default is `5`, and the minimum is `1`. |
| Debug | Logs every cache and lock operation to the console. Disabled by default. |
```yaml
lock:
heartbeat-interval-seconds: 5
ttl-seconds: 15
poll-interval-ms: 200
max-wait-ms: 15000
```
> **Info:**
The two lock timing options are not written into `redis.yml` when the file is first created. Add them yourself if you need to change them from the defaults above.
> **Info:**
If the connection to Redis fails on startup, the add-on logs a warning and the plugin keeps running on the database alone, without cross-server messaging.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/redis
---
# 🔁 Reward On Loop
## Information
The Reward On Loop add-on gives a reward to every online player on a fixed timer, independently from crates and keys.
Reward On Loop - Add-On
👉 [You can claim this add-on for free on Phoenix Plugins](https://www.phoenixplugins.com/product/reward-on-loop)
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition. PlaceholderAPI is only needed for the countdown placeholders, the rewards themselves fire without it.
## Loop Rewards
Loop rewards are reached from the Reward On Loop button in the main editor. Each one runs on its own timer, so several can fire on completely different schedules.
Editor
### Add Loop Reward
Creates a new loop reward and opens it for editing. There is no limit on how many you can have, and a new one starts on its interval right away.
Editor > Loop Rewards
### Display Item
The icon and name the reward is listed under in the editor. It is never given to anyone, but its name is what `%reward%` prints in the win message.
Editor > Loop Reward
### Win Items
The physical items handed to each player when the reward fires.
Editor > Loop Reward
### Win Commands
The commands run when the reward fires, once per receiving player.
Editor > Loop Reward
### Win Message
The message each receiving player is sent. Leaving it empty sends nothing at all, which is the way to make a reward arrive silently.
Editor > Loop Reward
### Interval (seconds)
How long between two firings of this reward. Changing it restarts the countdown, so the next reward is a full interval away rather than carrying over what had already elapsed.
An interval of `0` stops the reward from ever firing, which is how a loop reward is paused without deleting it.
Editor > Loop Reward
### Timer Mode
Whether the countdown is shared or personal. Changing it restarts the countdown the same way the interval does.
| Mode | Behaviour |
| ---- | --------- |
| Global | One countdown for the whole server, so everyone is rewarded at the same moment. This is the default. |
| Per Player | Each player has their own countdown, starting the moment they join. |
Editor > Loop Reward
> **Warning:**
A Per Player countdown is dropped when the player disconnects, so they begin a fresh interval on their next join instead of resuming where they left off. A player who reconnects often enough never reaches the reward.
### Required Permissions
Restricts the reward to players holding at least one of the listed permissions. An empty list, which is the default, gives it to everyone.
Editor > Loop Reward
### Max Win Item Amount
Caps how many of the win items are actually delivered per firing. Unlimited hands over the whole list.
Editor > Loop Reward
### Max Win Command Amount
The same cap for the win commands.
Editor > Loop Reward
### Max Wins Per Player
How many times one player may receive this reward before being skipped for good.
Editor > Loop Reward
> **Info:**
Win counts are held in memory only, so a server restart lets everyone win up to the cap again. Renaming the reward's identifier clears them the same way.
### Identifier
The internal name the countdown placeholders address the reward by. It cannot contain spaces, and renaming it restarts the countdown.
Editor > Loop Reward
### Delete
Permanently removes the loop reward after a confirmation prompt.
Editor > Loop Reward
> **Info:**
With the [IP Limit](../ip-limit/) add-on installed, a loop reward reaches only a limited number of accounts per IP address each time it fires. That cap is set under Global Limits and cannot be overridden per key or crate.
## Placeholders
Every placeholder reports the time left until a loop reward fires again. With Per Player timer mode they show the viewing player's own countdown, and with Global they show the one shared countdown.
| Placeholder | Description |
| ----------- | ----------- |
| %phoenixcrates_rewardonloop_nextReward_\% | Time remaining, formatted as `1h 20m 5s`. |
| %phoenixcrates_rewardonloop_nextReward_\_hours% | Whole hours remaining. |
| %phoenixcrates_rewardonloop_nextReward_\_minutes% | Minutes remaining within the current hour. |
| %phoenixcrates_rewardonloop_nextReward_\_seconds% | Seconds remaining within the current minute. |
The three unit variants are parts of one countdown rather than three separate totals, so they are meant to be combined into a single line.
A reward identifier that does not exist reports zero rather than an error, so a countdown stuck at `0s` usually means the identifier is misspelled.
> **Info:**
`hours`, `minutes`, `seconds` and `formatted` are read as unit suffixes, so a reward whose identifier ends in one of them cannot be queried. Rename it if a countdown refuses to resolve.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/reward-on-loop
---
# 🎁 Loop Rewards
## Reward On Loop
Loop rewards are reached from the Reward On Loop button in the main editor. Each one runs on its own timer, so several can fire on completely different schedules.
Editor
## Add Loop Reward
Creates a new loop reward and opens it for editing. There is no limit on how many you can have, and a new one starts on its interval right away.
Editor > Loop Rewards
## Display Item
The icon and name the reward is listed under in the editor. It is never given to anyone, but its name is what `%reward%` prints in the win message.
Editor > Loop Reward
## Win Items
The physical items handed to each player when the reward fires.
Editor > Loop Reward
## Win Commands
The commands run when the reward fires, once per receiving player.
Editor > Loop Reward
## Win Message
The message each receiving player is sent. Leaving it empty sends nothing at all, which is the way to make a reward arrive silently.
Editor > Loop Reward
## Interval (seconds)
How long between two firings of this reward. Changing it restarts the countdown, so the next reward is a full interval away rather than carrying over what had already elapsed.
An interval of `0` stops the reward from ever firing, which is how a loop reward is paused without deleting it.
Editor > Loop Reward
## Timer Mode
Whether the countdown is shared or personal. Changing it restarts the countdown the same way the interval does.
| Mode | Behaviour |
| ---- | --------- |
| Global | One countdown for the whole server, so everyone is rewarded at the same moment. This is the default. |
| Per Player | Each player has their own countdown, starting the moment they join. |
Editor > Loop Reward
> **Warning:**
A Per Player countdown is dropped when the player disconnects, so they begin a fresh interval on their next join instead of resuming where they left off. A player who reconnects often enough never reaches the reward.
## Required Permissions
Restricts the reward to players holding at least one of the listed permissions. An empty list, which is the default, gives it to everyone.
Editor > Loop Reward
## Max Win Item Amount
Caps how many of the win items are actually delivered per firing. Unlimited hands over the whole list.
Editor > Loop Reward
## Max Win Command Amount
The same cap for the win commands.
Editor > Loop Reward
## Max Wins Per Player
How many times one player may receive this reward before being skipped for good.
Editor > Loop Reward
> **Info:**
Win counts are held in memory only, so a server restart lets everyone win up to the cap again. Renaming the reward's identifier clears them the same way.
## Identifier
The internal name the countdown placeholders address the reward by. It cannot contain spaces, and renaming it restarts the countdown.
Editor > Loop Reward
## Delete
Permanently removes the loop reward after a confirmation prompt.
Editor > Loop Reward
> **Info:**
With the [IP Limit](../ip-limit/) add-on installed, a loop reward reaches only a limited number of accounts per IP address each time it fires. That cap is set under Global Limits and cannot be overridden per key or crate.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/reward-on-loop/loop-rewards
---
# 📜 Placeholders
## PlaceholderAPI Placeholders
Every placeholder reports the time left until a loop reward fires again. With Per Player timer mode they show the viewing player's own countdown, and with Global they show the one shared countdown.
| Placeholder | Description |
| ----------- | ----------- |
| %phoenixcrates_rewardonloop_nextReward_\% | Time remaining, formatted as `1h 20m 5s`. |
| %phoenixcrates_rewardonloop_nextReward_\_hours% | Whole hours remaining. |
| %phoenixcrates_rewardonloop_nextReward_\_minutes% | Minutes remaining within the current hour. |
| %phoenixcrates_rewardonloop_nextReward_\_seconds% | Seconds remaining within the current minute. |
The three unit variants are parts of one countdown rather than three separate totals, so they are meant to be combined into a single line.
A reward identifier that does not exist reports zero rather than an error, so a countdown stuck at `0s` usually means the identifier is misspelled.
> **Info:**
`hours`, `minutes`, `seconds` and `formatted` are read as unit suffixes, so a reward whose identifier ends in one of them cannot be queried. Rename it if a countdown refuses to resolve.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/reward-on-loop/placeholders
---
# 🎟️ Vouchers
## Information
The Vouchers add-on adds redeemable codes. A code can hand out crate keys, items and commands, and can be limited by how many times it is used in total, how many times one player may use it, and when it stops working.
It is the piece a giveaway needs: a code posted in Discord, a code bundled with a store purchase, or a one-off code for a single player, all created in game without editing a file.
## Installation
To install this add-on, you can either:
- Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
- Download the plugin with the add-on selected during the downloading.
> **Warning:**
The add-on requires the Premium edition.
## Files
| File | What it holds |
| ---- | ------------- |
| `PhoenixCrates/vouchers.yml` | The codes, their rewards and the code generator settings. |
| `PhoenixCrates/translations/vouchers.translations..yml` | The add-on messages. |
Which codes a player has redeemed is stored per player in the database, in the `player_vouchers_table` table. The number of times a code has been used across the whole server is stored on the code itself in `vouchers.yml`, so it survives a restart.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/vouchers
---
# 🏷️ Codes
## Codes
Every code lives under `vouchers` in vouchers.yml.
```yaml
generated-code-alphabet: ABCDEFGHJKLMNPQRSTUVWXYZ23456789
generated-code-length: 8
vouchers:
'0':
code: SUMMER25
enabled: true
display-name: '&6Summer Giveaway'
display-item:
material: PAPER
display-name: '&aVoucher'
amount: 1
key-rewards:
'0':
key: vote
amount: 5
win-items: {}
win-commands: []
redeem-message:
- '&aYou redeemed the code &f%code%&a!'
broadcast-message:
- '&e%player% &aredeemed the code &f%code%&a!'
broadcast: false
max-uses: 100
max-uses-per-player: 1
expires-at: -1
permission: ''
uses: 0
max-win-item-amount: -1
max-win-command-amount: -1
```
> **Info:**
Codes and their key rewards are stored as numbered sections rather than YAML lists, the same shape the crate rewards use. The numbers are positions only and have to stay unique inside their section.
## Options
| Option | What it does |
| ------ | ------------ |
| `code` | What the player types. Matched without regard to casing, so `summer25` and `SUMMER25` are the same code. |
| `enabled` | Switches the code off without deleting it or losing its usage count. |
| `display-name` | A friendly name used in messages. Falls back to the code itself when empty. |
| `display-item` | The icon the reward pipeline uses when the items are handed over. |
| `key-rewards` | The keys the code gives, as a list of `key` and `amount` pairs. |
| `win-items` | Items the code gives. |
| `win-commands` | Commands run when the code is redeemed. Prefix a command with `*` to run it as the player instead of the console. |
| `redeem-message` | Sent to the player who redeemed the code. |
| `broadcast-message` | Sent to every online player, only when `broadcast` is on. |
| `broadcast` | Announces the redemption to the whole server. |
| `max-uses` | Redemptions allowed across the whole server, `-1` for unlimited. |
| `max-uses-per-player` | Redemptions allowed per player, `-1` for unlimited. Defaults to `1`. |
| `expires-at` | Epoch milliseconds after which the code stops working, `-1` for never. |
| `permission` | The player needs this to redeem the code. Leave empty for everyone. |
| `uses` | How many times the code has been redeemed. Maintained by the plugin. |
| `max-win-item-amount` | How many of the win items are given, `-1` for all of them. |
| `max-win-command-amount` | How many of the win commands are run, `-1` for all of them. |
> **Warning:**
`uses` is written by the plugin. Editing it by hand changes how many redemptions are left on a code with a `max-uses` cap, and setting it back to `0` reopens a code that had run out.
## Limits
The two caps do different jobs and are usually combined. `max-uses-per-player` stops one player redeeming the same code repeatedly, and `max-uses` caps the giveaway as a whole.
Both are enforced at the moment of redemption rather than on a timer, so two players redeeming the last remaining use at the same instant cannot both get through — one of them is told the code is exhausted.
## Generated codes
`generated-code-alphabet` and `generated-code-length` control the codes produced by `/crate createVoucher` when it is asked to generate one.
The default alphabet leaves out `I`, `O`, `0` and `1`, so a code read off a screenshot or a Discord message cannot be mistyped into a different valid code. Generated codes are always checked against the existing ones before being used.
## Message placeholders
`redeem-message` and `broadcast-message` accept:
| Placeholder | Value |
| ----------- | ----- |
| `%player%` | The player who redeemed the code. |
| `%code%` | The code itself. |
| `%voucher%` | The display name, falling back to the code. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/vouchers/codes
---
# 🤖 Commands
## Player Commands
* `/crate redeem ` - Redeems a code. Needs no permission, though an individual code can require one through its own `permission` option.
## Admin Commands
* `/crate createVoucher [amount] [uses]` - Creates a code granting a number of one key. Pass `-` as the code to generate one instead of choosing it. `uses` is the total across the server, `-1` for unlimited. Requires `phoenixcrates.command.createvoucher`.
* `/crate deleteVoucher ` - Deletes a code. Requires `phoenixcrates.command.deletevoucher`.
* `/crate vouchers` - Lists every code with its usage count and status. Requires `phoenixcrates.command.vouchers`.
* `/crate resetVouchers ` - Clears which codes a player has redeemed, letting them redeem them all again. Requires `phoenixcrates.command.resetvouchers`.
## Permissions
| Permission | What it allows |
| ---------- | -------------- |
| `phoenixcrates.command.createvoucher` | Creating codes. |
| `phoenixcrates.command.deletevoucher` | Deleting codes. |
| `phoenixcrates.command.vouchers` | Listing codes. |
| `phoenixcrates.command.resetvouchers` | Resetting a player's redeemed codes. |
## Creating a code in game
```
/crate createVoucher SUMMER25 vote 5 100
```
Creates `SUMMER25`, granting five `vote` keys, redeemable a hundred times across the server and once per player.
```
/crate createVoucher - legendary 1 1
```
Generates a code granting a single `legendary` key that only one player can ever use, which is the shape a personal reward or a single-winner giveaway takes.
A code made this way is written straight into vouchers.yml and works immediately, with no reload. Anything the command does not cover — items, commands, an expiry date, a permission — is edited into the file afterwards.
> **Info:**
The command refuses a code that already exists rather than overwriting it, so an accidental repeat cannot wipe the usage count of a live giveaway.
## Status in the list
`/crate vouchers` marks each code as one of:
| Status | Meaning |
| ------ | ------- |
| `active` | Redeemable. |
| `disabled` | `enabled` is off. |
| `expired` | Past its `expires-at`. |
| `exhausted` | Has reached `max-uses`. |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/add-ons/vouchers/commands
---
# 🌐 API
> **Danger:**
The API is only available for the premium version of the plugin.
Build your own extensions for Phoenix Crates with our public API. [Events](events.md) and [Examples](examples.md) have their own pages.
## Maven Repository
```xml
phoenixpluginshttps://repo.phoenixplugins.com/
```
## Dependency
```xml
com.phoenixplugins.phoenixcratesapi1.0.0-SNAPSHOT
```
## Advanced Access (Internal Classes)
Our public API covers the recommended integration points for addons.
If you need deeper access to internal classes and systems, we recommend using a direct `systemPath` dependency to your local Phoenix Crates plugin JAR.
```xml
com.phoenixplugins.phoenixcratesinternal1.0.0-SNAPSHOTsystem${project.basedir}/libs/PhoenixCrates-1.0.0-SNAPSHOT.jar
```
Place the plugin JAR in your project's `libs` folder before building.
## JavaDocs
* [Open Phoenix Crates JavaDocs](https://www.phoenixplugins.com/javadocs/phoenix-crates)
## Custom Addons
Custom Addons are extensions that allow you to extend, modify, or enhance Phoenix Crates behavior with your own Java code.
### Before You Start
1. Add the [Maven Repository](#maven-repository) and the [Dependency](#dependency) above.
2. Create your addon project (Maven or Gradle).
3. Make sure your final artifact is a shaded or standalone JAR when needed.
### addon.yml
Create an `addon.yml` file in your project's resources folder.
```yaml
name: AddonName
main: your.path.AddonExample
author: [YourName]
version: 1.0.0
description: Small description (optional)
website: https://your-website.com (optional)
```
Required fields:
* `name`: Display name of your addon.
* `main`: Fully qualified path to your addon main class.
* `author`: One or more addon authors.
* `version`: Addon version.
### Main Class Example
The `main` value in `addon.yml` must point to your class that extends `Addon`.
```java
package your.path;
import com.phoenixplugins.phoenixcrates.api.sdk.plugin.addons.Addon;
public class AddonExample extends Addon {
@Override
public void onLoad() {
// Called when the addon is loaded.
}
@Override
public void onEnable() {
// Register listeners, commands, tasks, etc.
}
@Override
public void onDisable() {
// Cleanup logic.
}
@Override
public String getRequiredPluginVersion() {
return "5.0.0";
}
}
```
### Build and Install
1. Build your addon JAR with your normal project build command.
2. Move the compiled JAR into `plugins/PhoenixCrates/addons`.
3. Restart the server.
4. Check console logs to confirm the addon was loaded successfully.
## Custom Animations
Create your own opening phase animations and register them at runtime through the API.
### 1. Create Your Phase Class
Extend `OpeningPhaseAnimation` and implement the lifecycle methods:
```java
public class YourPhaseAnimation extends OpeningPhaseAnimation {
public YourPhaseAnimation(OpeningCrateAnimation animation, OpeningPhaseType type,
EmptyOpeningPhaseData data) {
super(animation, type, data);
}
@Override
public void load() {
}
@Override
public void tick() {
}
@Override
public void unload() {
}
}
```
### 2. Register on Enable
Register your phase during addon startup and unregister it on shutdown:
```java
public void onEnable() {
registerPhase(
new OpeningPhaseType(PhaseType.FIRST, "YOUR_PHASE_IDENTIFIER",
"Your Display Name",
XMaterial.STONE, ServerVersion.v1_16_R1,
new XMaterial[] {}, EmptyOpeningPhaseData.class,
(animation, type, data) -> new YourPhaseAnimation(animation,
type, (EmptyOpeningPhaseData) data),
() -> new EmptyOpeningPhaseData()));
}
public void onDisable() {
for (final OpeningPhaseType type : this.registeredPhases) {
OpeningPhaseType.unregisterPhase(type);
}
}
private void registerPhase(OpeningPhaseType phase) {
// Registering first phase animations
OpeningPhaseType.registerPhase(phase);
// Caching to unload later on
this.registeredPhases.add(phase);
}
```
### Good Practices
* Use unique identifiers for each custom phase.
* Keep heavy logic out of `tick()` when possible.
* Always unregister phases in `onDisable()`.
* Test phases on the same Minecraft version as production.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/api
---
# 🔧 Custom Addons
> **Danger:**
The API is only available for the premium version of the plugin.
Custom Addons are extensions that allow you to extend, modify, or enhance Phoenix Crates behavior with your own Java code.
## Before You Start
1. Add the API dependency from the [API page](README.md).
2. Create your addon project (Maven or Gradle).
3. Make sure your final artifact is a shaded or standalone JAR when needed.
## addon.yml
Create an `addon.yml` file in your project's resources folder.
```yaml
name: AddonName
main: your.path.AddonExample
author: [YourName]
version: 1.0.0
description: Small description (optional)
website: https://your-website.com (optional)
```
Required fields:
* `name`: Display name of your addon.
* `main`: Fully qualified path to your addon main class.
* `author`: One or more addon authors.
* `version`: Addon version.
## Main Class Example
The `main` value in `addon.yml` must point to your class that extends `Addon`.
```java
package your.path;
import com.phoenixplugins.phoenixcrates.api.sdk.plugin.addons.Addon;
public class AddonExample extends Addon {
@Override
public void onLoad() {
// Called when the addon is loaded.
}
@Override
public void onEnable() {
// Register listeners, commands, tasks, etc.
}
@Override
public void onDisable() {
// Cleanup logic.
}
@Override
public String getRequiredPluginVersion() {
return "5.0.0";
}
}
```
## Build and Install
1. Build your addon JAR with your normal project build command.
2. Move the compiled JAR into `plugins/PhoenixCrates/addons`.
3. Restart the server.
4. Check console logs to confirm the addon was loaded successfully.
## Next Step
After your addon loads correctly, continue with [🎞️ Custom Animations](custom-animations.md) to register your own crate animation phases.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/api/custom-addons
---
# 🎞️ Custom Animations
> **Danger:**
The API is only available for the premium version of the plugin.
Create your own opening phase animations and register them at runtime through the API.
## 1. Create Your Phase Class
Extend `OpeningPhaseAnimation` and implement the lifecycle methods:
```java
public class YourPhaseAnimation extends OpeningPhaseAnimation {
public YourPhaseAnimation(OpeningCrateAnimation animation, OpeningPhaseType type,
EmptyOpeningPhaseData data) {
super(animation, type, data);
}
@Override
public void load() {
}
@Override
public void tick() {
}
@Override
public void unload() {
}
}
```
## 2. Register on Enable
Register your phase during addon startup and unregister it on shutdown:
```java
public void onEnable() {
registerPhase(
new OpeningPhaseType(PhaseType.FIRST, "YOUR_PHASE_IDENTIFIER",
"Your Display Name",
XMaterial.STONE, ServerVersion.v1_16_R1,
new XMaterial[] {}, EmptyOpeningPhaseData.class,
(animation, type, data) -> new YourPhaseAnimation(animation,
type, (EmptyOpeningPhaseData) data),
() -> new EmptyOpeningPhaseData()));
}
public void onDisable() {
for (final OpeningPhaseType type : this.registeredPhases) {
OpeningPhaseType.unregisterPhase(type);
}
}
private void registerPhase(OpeningPhaseType phase) {
// Registering first phase animations
OpeningPhaseType.registerPhase(phase);
// Caching to unload later on
this.registeredPhases.add(phase);
}
```
## Good Practices
* Use unique identifiers for each custom phase.
* Keep heavy logic out of `tick()` when possible.
* Always unregister phases in `onDisable()`.
* Test phases on the same Minecraft version as production.
## Need Addon Setup First?
If you have not created your addon bootstrap yet, start with [🔧 Custom Addons](custom-addons.md).
Source: https://www.phoenixplugins.com/docs/phoenix-crates/api/custom-animations
---
# 📡 Events
> **Danger:**
The API is only available for the premium version of the plugin.
All events are standard Bukkit events, registered the usual way with `@EventHandler`. Crate events live in `com.phoenixplugins.phoenixcrates.api.crate.events`, item delivery in `com.phoenixplugins.phoenixcrates.api.events.items`.
## Event List
| Event | Fires when | Cancellable |
| ---------------------------- | --------------------------------------------------------------- | ----------- |
| `CratePlaceEvent` | A player places a crate item in the world | Yes |
| `CratePreviewOpenEvent` | The rewards preview menu is about to open | Yes |
| `CratePreOpenEvent` | An opening has been requested, before any check runs | Yes |
| `CrateOpenEvent` | The opening has started | No |
| `CrateRewardSelectionEvent` | A random crate is choosing which reward to award | No |
| `CrateSelectiveConfirmEvent` | A player confirms a reward in Selective mode | Yes |
| `CratePreRerollEvent` | A reroll has been requested | Yes |
| `CrateRerollEvent` | A reroll has produced a new reward | No |
| `CrateRewardWinItemsEvent` | The item list for a win has been built, before it is given | No |
| `CrateRewardPlayerEvent` | A player has been awarded a reward | No |
| `ItemDeliveryEvent` | Items are about to be delivered to a player | No |
Several of these are not cancellable but still let a listener change the outcome, which is covered per event below.
## CratePlaceEvent
Fired when a player places a crate item. Exposes `getCrate()` (the `CrateType`), `getWhoPlaced()` and `getLocation()`.
> **Warning:**
This event fires **before** the `phoenixcrates.admin` check. A listener that only wants to veto placements in protected regions should not assume the placement would otherwise have succeeded.
## CratePreviewOpenEvent
Fired before the rewards preview opens. Exposes `getCrateType()`, `getPlayer()` and `getPreviewMenu()`, the name of the menu that is about to be used. Cancel it to block the preview.
## CratePreOpenEvent
Fired as soon as an opening is requested and before the plugin checks keys, permission, cooldown or cost. Cancel it to stop the opening with no key consumed. Exposes `getCrate()`, `getPlayer()` and `getType()`.
This is the event to use for your own access rules. See [Examples](examples.md).
## CrateOpenEvent
Fired once an opening has passed every check and has started. Not cancellable, since the key has already been taken. Use it for logging and metrics, which is exactly what the built-in logger does.
## CrateRewardSelectionEvent
Fired while a crate in Random mode is picking a reward. Exposes `getCrate()`, `getPlayer()`, `getKey()` and `getCandidates()`, the rewards that are currently eligible for this player.
To choose the reward yourself, call `setSelectedReward()` **and** `setHandled(true)`. Setting the reward without marking the event handled lets the normal selection run and replace your choice.
## CrateSelectiveConfirmEvent
Fired when a player confirms a reward on a crate in Selective (non RNG) mode. Exposes `getCrate()`, `getPlayer()` and `getSelectedReward()`. Cancel it to refuse the selection.
## CratePreRerollEvent
Fired when a player requests a reroll. Exposes `getSession()`, the active `OpeningSession`. Cancel it to refuse the reroll, or call `setHandled(true)` to tell the plugin your listener has taken over the reroll itself.
## CrateRerollEvent
Fired once a reroll has run and produced a new reward, so it is the counterpart to `CratePreRerollEvent`. Exposes `getCrate()`, `getPlayer()` and `getReward()`, the reward the reroll landed on.
A reroll in a normal opening replaces every reward, so the event fires once per new reward. A reroll from the Mass Opening menu targets one reward, so it fires once.
Use it for logging and metrics. To actually block or take over a reroll, use `CratePreRerollEvent`.
## CrateRewardWinItemsEvent
Fired after the final item list for a win has been built and before those items reach the player. Exposes `getCrate()`, `getReward()`, `getPlayer()` and a mutable `getWinItems()`, which `setWinItems()` can replace outright.
This is the place to add a bonus item, apply your own NBT, or swap items per player.
## CrateRewardPlayerEvent
Fired when a player is awarded a reward. Exposes `getCrate()`, `getPlayer()` and `getReward()`, which is settable.
## ItemDeliveryEvent
Fired whenever the plugin hands items to a player, whether from an opening or from a command. Exposes `getPlayer()`, `getPlayerData()`, `getRemainingItems()` and `getSource()`, which is one of `KEY_GRANT`, `CRATE_GRANT` or `REWARD_GRANT`.
Edit `getRemainingItems()` or call `setRemainingItems()` to change what is delivered, and `consumeAll()` to take responsibility for every item yourself, which is how the Crate Claim add-on stores items for offline players.
Use `getRemainingItemsSnapshot()` if you need a copy that is safe to hold onto.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/api/events
---
# 🧪 Examples
> **Danger:**
These examples target the public API module and are written to avoid depending on internal classes.
## 1) Listen and override reward selection
Use `CrateRewardSelectionEvent` to choose a reward yourself.
```java
import com.phoenixplugins.phoenixcrates.api.crate.events.CrateRewardSelectionEvent;
import com.phoenixplugins.phoenixcrates.api.reward.BaseReward;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.Comparator;
public final class RewardSelectionListener implements Listener {
@EventHandler
public void onRewardSelection(CrateRewardSelectionEvent event) {
BaseReward best = event.getCandidates().stream()
.max(Comparator.comparingDouble(BaseReward::getWeight))
.orElse(null);
if (best != null) {
event.setSelectedReward(best);
event.setHandled(true);
}
}
}
```
Do not set only `selectedReward` and forget `handled`, otherwise the default flow can still replace your choice.
## 2) Validate opening attempts before they start
Use `CratePreOpenEvent` when you want to block a crate opening with your own checks.
```java
import com.phoenixplugins.phoenixcrates.api.crate.events.CratePreOpenEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public final class OpenGuardListener implements Listener {
@EventHandler
public void onPreOpen(CratePreOpenEvent event) {
if (!event.getPlayer().hasPermission("myaddon.open")) {
event.setCancelled(true);
event.getPlayer().sendMessage("You cannot open this crate right now.");
}
}
}
```
## 3) Query crates from the manager
Access the manager through `PhoenixCratesAPI`.
```java
import com.phoenixplugins.phoenixcrates.api.PhoenixCratesAPI;
import com.phoenixplugins.phoenixcrates.api.crate.CrateType;
import java.util.List;
public final class CratesDebugService {
public List extends CrateType> getEnabledTypes() {
return PhoenixCratesAPI.getCratesManager().getCrateTypes();
}
public int getRegisteredCount() {
return PhoenixCratesAPI.getCratesManager().countRegisteredTypes();
}
}
```
## 4) Inject a custom player data layer
The player data layer supports chain-of-responsibility style custom caching.
```java
import com.phoenixplugins.phoenixcrates.api.PhoenixCratesAPI;
import com.phoenixplugins.phoenixcrates.api.player.PlayerDataLayer;
import com.phoenixplugins.phoenixcrates.api.player.PlayerDbModel;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
public final class MyDataLayer implements PlayerDataLayer {
private PlayerDataLayer next;
@Override
public CompletableFuture extends PlayerDbModel> fetchByUniqueId(UUID uniqueId) {
return next == null
? CompletableFuture.completedFuture(null)
: next.fetchByUniqueId(uniqueId);
}
@Override
public CompletableFuture insert(T model) {
return next.insert(model);
}
@Override
public CompletableFuture update(T model) {
return next.update(model);
}
@Override
public void setNextLayer(PlayerDataLayer nextLayer) {
this.next = nextLayer;
}
@Override
public PlayerDataLayer getNextLayer() {
return this.next;
}
}
// During addon load:
// PhoenixCratesAPI.getPlayersManager().setPlayerDataLayer(new MyDataLayer());
```
Do not block the main thread waiting for `CompletableFuture` results.
## 5) Read player crate data safely
Use the async fetch API for offline/online players.
```java
import com.phoenixplugins.phoenixcrates.api.PhoenixCratesAPI;
import org.bukkit.OfflinePlayer;
public final class PlayerDataService {
public void loadData(OfflinePlayer player) {
PhoenixCratesAPI.getPlayersManager()
.fetchPlayerDataAsync(player)
.thenAccept(data -> {
if (data != null) {
// Read fields/modules from your callback.
}
});
}
}
```
## 6) Track openings and rerolls for analytics
Listen to open and reroll events for metrics or logs.
```java
import com.phoenixplugins.phoenixcrates.api.crate.events.CrateOpenEvent;
import com.phoenixplugins.phoenixcrates.api.crate.events.CrateRerollEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public final class AnalyticsListener implements Listener {
@EventHandler
public void onOpen(CrateOpenEvent event) {
// Store event.getPlayer().getUniqueId() + event.getType().getIdentifier()
}
@EventHandler
public void onReroll(CrateRerollEvent event) {
// Store event.getPlayer().getUniqueId() + event.getReward().getIdentifier()
}
}
```
> **Info:**
A reroll in a normal opening replaces every reward, so `CrateRerollEvent` fires once per new reward. To block or take over a reroll instead of recording it, use `CratePreRerollEvent`. Every event is listed on the [Events](events.md) page.
## 7) Customize final item delivery
Use `ItemDeliveryEvent` to edit or consume the list of items before they are delivered.
```java
import com.phoenixplugins.phoenixcrates.api.events.items.ItemDeliveryEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.List;
public final class ItemDeliveryListener implements Listener {
@EventHandler
public void onDelivery(ItemDeliveryEvent event) {
List filtered = new ArrayList<>(event.getRemainingItemsSnapshot());
filtered.removeIf(item -> item.getAmount() <= 0);
event.setRemainingItems(filtered);
}
}
```
## 8) Inspect and manage animation phases
Use the animation registry to discover or register phases.
```java
import com.phoenixplugins.phoenixcrates.api.PhoenixCratesAPI;
import com.phoenixplugins.phoenixcrates.api.crate.animation.AnimationPhase;
import com.phoenixplugins.phoenixcrates.api.crate.animation.PhaseType;
import java.util.Collection;
import java.util.Optional;
public final class AnimationRegistryService {
public Collection getOpeningPhases() {
return PhoenixCratesAPI.getAnimationsRegistry().getPhases(PhaseType.OPENING);
}
public Optional findById(String id) {
return PhoenixCratesAPI.getAnimationsRegistry().getPhaseById(PhaseType.OPENING, id);
}
}
```
## What is not supported by API-only integrations
* Do not depend on internal classes from plugin modules outside `com.phoenixplugins.phoenixcrates.api.*`.
* Do not call methods marked internal/unsafe unless you are maintaining plugin internals.
* Do not assume constructor availability for concrete runtime implementations.
* Do not override the full opening flow by reflection; use events and managers instead.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/api/examples
---
# 📂 Crate Configuration File
## Example Crate
Each crate has its file inside the crates folder. Check the default structure of a crate:
```yml
enabled: true
identifier: example1
item:
material: custom:example_crate
amount: 1
display-name: '&eExample #1'
block-material: BROWN_WOOL
engine: VANILLA_BLOCK
open-cost:
engine: NONE
amount: 0.0
currency: ''
key-skips-cost: false
open-cooldown: 0
simultaneous-openings: true
preview-item: false
permission:
required: false
permission: phoenixcrates.crate.example1
idle-effects:
- CIRCLE;{REDSTONE;#ff0000;0.0;1.0;2.0;0.0;0.0;1}
opening-animation:
pre-open: DEFAULT
open: SPOTLIGHT_GUI
display: NONE
hologram:
type: BUILTIN
offset: 0.0
lines:
- '&e&l%name%'
- ''
- '&aRight &7Click to open'
- '&cLeft &7Click to preview'
menus:
rewards: default_rewards_preview
select-reward: default_select_reward
rerolls: default_crate_reroll
preview-actions: []
key-required: true
linked-keys-ids:
- example1
allow-open-command: true
broadcast:
message: '&ePlayer &a%player% &ejust got &6"%reward%" &ereward from the crate &6%crate%&e!'
max-win-rewards: 0
rewards-mode: RANDOM
rewards:
'0':
enabled: true
identifier: reward_1783907600221
display-item:
material: custom:example_crate
amount: 4
win-items:
'0':
material: custom:grass_block
amount: 1
win-commands: []
broadcast: false
weight: 100.0
win-limits: -1
global-win-limit: -1
cooldowns:
win-limit-cooldown: 0
global-win-limit-cooldown: 0
time-limited-cooldown: 0
time-limited-expiry: 0
guaranteed-win: -1
required-keys: 1
allow-win-message: false
notification-type: CHAT
share-players-online: false
restricted-permissions: []
required-permissions: []
max-win:
item-amount: 1
command-amount: -1
alternative-reward:
enabled: false
reward:
item:
material: DIAMOND_PICKAXE
display-name: '&aAlternative Item'
amount: 1
virtual: false
broadcast: false
allow-win-message: true
share-players-online: false
commands: []
guaranteed-reward-type: DISABLED
reroll:
enabled: false
free-rolls: 0
groups:
'0':
namespace: common
rerolls: 3
replay-animation: false
skip-same-reward: false
extra-settings:
animation:
display-item-position:
x: 0.0
y: 2.0
z: 0.0
display-item-name-position:
x: 0.0
y: 0.3
z: 0.0
skip-on-esc: false
clicks:
open: RIGHT
preview: LEFT
event-actions:
open: []
win: []
close: []
denied: []
```
## Clicks
`clicks` takes `LEFT`, `RIGHT`, `BOTH` or `NONE`, as set from [Click Behaviour](../main-features/crates/README.md#click-behaviour).
## Event Actions
`event-actions` overrides the global lists from `config.yml` for this crate, event by event. A reward can also carry a `win-actions` list of its own, which takes over from both. See [Event Actions](../main-features/crates/README.md#event-actions).
## Idle Effects
The `idle-effects` lines pack a whole particle effect into one string, in the form `TYPE;{PARTICLE;COLOR;offsetX;offsetY;offsetZ;spread;velocity;amount}`. Each field is explained on the [Idle Animations](../main-features/animations/README.md#in-the-config-file) page.
## Item Storage
Every crate file starts with an `internal-storage` section holding the raw items the crate uses, each under a name that the rest of the file points at with `custom:`. It is written by the plugin, so a crate item, a reward item or a display item edited from the editor ends up there instead of being repeated inline.
Editing an item by hand means editing its entry in that section. Removing an entry that something still points at leaves that part of the crate without an item.
## Add-on Sections
Installed add-ons append their own section to every crate file, and Mass Opening also adds its two menu names into the existing `menus` section. A file only grows once the add-on has run for the first time, and deleting a section makes it come back with its defaults.
```yml
mass-opening:
enabled: false
presets:
first:
enabled: true
amount: 6
open-all:
enabled: true
max-amount: 100
lootbox:
enabled: false
menus:
mass-reroll: default_crate_mass_reroll
mass-selective: default_crate_mass_selective
```
## File Structure
Everything the plugin writes lives in plugins/PhoenixCrates.
```
plugins/PhoenixCrates/
├── addons/
├── crates/
├── keys/
├── menus/
├── translations/
├── internal/
├── logs/
├── config.yml
├── locations.yml
├── internal_storage.yml
├── messages.yml
└── rarities.yml
```
### Folders
| Folder | Contents |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| **crates** | One file per crate. See [Example Crate](#example-crate). |
| **keys** | One file per key. |
| **menus** | The menu layouts. See [Customize Menus](customize-menus.md). |
| **addons** | Add-on jars. Drop a new add-on here and restart. |
| **translations** | The language files. See [Languages & Translations](languages.md). |
| **internal** | Plugin-managed working data. Never edit this by hand. |
| **logs** | Written by the logger. See [Log the Actions](../features/log-the-actions.md). |
### Files
| File | Contents |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- |
| **config.yml** | The main settings, the database connection and the license. See [Main Configuration](main-configuration.md). |
| **locations.yml** | Every crate placed in the world, with its coordinates and facing. See the note below. |
| **internal_storage.yml** | Items saved from the editor that are not tied to a single crate. |
| **messages.yml** | Legacy message file, kept for configurations made before translations were introduced. |
| **rarities.yml** | The rarities, when the Rarity add-on is installed. |
Installed add-ons add one file each: `crate-claim.yml`, `mass-opening.yml`, `ip-limit.yml`, `reward-on-loop.yml`, `redis.yml`, and `logger.yml` for the logger.
> **Warning:**
locations.yml is what makes a placed crate exist. Deleting it leaves every crate configured but no longer placed anywhere in the world.
### What Lives in the Database
Player progress is **not** in these files. Virtual keys, open cooldowns, opened counts, win limits and rerolls are all stored in the database configured in `config.yml`, which is SQLite (a file inside the plugin folder) by default and MySQL if you set it up.
### Moving to Another Server
To carry your setup across:
* **Configuration** - copy `crates/`, `keys/`, `menus/`, `translations/`, `config.yml`, `internal_storage.yml`, `rarities.yml` and the add-on files.
* **Placed crates** - copy `locations.yml`, but only if the worlds come across too. A location pointing at a world that does not exist is skipped.
* **Player progress** - point the new server at the same MySQL database, or copy the SQLite file across.
> **Danger:**
If you copy `config.yml` to a second server, remember that a license only allows a limited number of concurrent sessions. See [Licensing](../plugin-information/licensing.md).
### What to Back Up
The whole plugins/PhoenixCrates folder, plus your database if you use MySQL. The editor writes changes to these files as you make them, so a backup taken while the server runs is a valid one.
### Reporting a Problem
Turning on `debug` in `config.yml` adds verbose console logging and creates a debug\_output folder with extra diagnostics. Both are useful to attach when you report an issue to us.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/configurations/crate-configuration-file
---
# 🎑 Customize Menus
## Crate Menus
All the crate menus you can customize for the plugin are located in the menus folder of Phoenix Crates. These menus are:
* The rewards preview menu - REWARDS\_PREVIEW
* The select reward menu - SELECT\_REWARD
* The confirmation menu - CONFIRMATION
* The reroll menu - CRATE\_REROLL
* The virtual keys menu - VIRTUAL\_KEYS
Add-ons register menus of their own, which only exist once the add-on is installed:
* The mass opening menu - CRATE\_MASS\_OPENING
* The mass reroll menu - CRATE\_MASS\_REROLL
* The mass selection menu - CRATE\_MASS\_SELECTIVE
* The claim menu - CRATE\_CLAIM
Menus Folder
If you want to have a different preview menu for a crate, you can simply create your own custom menu and attach it to the crate's [Preview Menu](../main-features/crates/README.md#menus) instead of changing the default one.
The layout of every menu can also be changed in-game with the [In-Game Menu Editor](in-game-menu-editor.md) ⭐.
## Menu Settings
Menu settings can be found in any type of menu. From there, you can specify the type of menu you want, the title of the menu, the number of rows it will have, the refresh rate, and the actions that will run when the user clicks to preview it.
```yaml
settings:
type: # REWARDS_PREVIEW, SELECT_REWARD, CONFIRMATION, CRATE_REROLL, VIRTUAL_KEYS
title: '%crate% Rewards'
rows: # 1, 2, 3, 4, 5, 6
refresh:
enabled: false
rate: 20
on-open-actions: []
```
You can change the rows number if you want to adjust the rows that the menu will have.
## Confirmation Menu
The confirmation menu is shown to players before an action is carried out, such as opening a crate with an Open Money Cost or picking a reward in Selective mode. It has its own `confirm` and `cancel` items alongside the usual `item-slot`, which shows the item the player is about to receive/select. This menu can be skipped entirely with the Disable Confirmation Menus option, found in the editor's Settings menu.
## Pagination
Pagination is another main option that menus have. With this, you can create multiple pages, set your preview page item, the next page item, and a material that will fill specific slots.
## Items
With the items, you can create custom entries to be included in your menu. These could be items to close the menu or items that display where players can purchase keys.
```yaml
items:
close-menu:
slot: '49'
material: ARROW
amount: 1
custom-model-data: 0
glow: false
hide-attributes: false
display-name: '&aClose Menu'
lore:
- '&7Click here to close this menu.'
- ''
- '&6Left-Click: &eClose menu.'
actions:
- '[CLOSE_INVENTORY]'
```
Two more options are available on any item and are not in the example above:
* **item-model** - The item model identifier to use, on server versions that support it.
* **hide-tooltip** - Hides the item's tooltip completely. This is what the filler panes in the default menus use.
The `slot` accepts a single slot (`'49'`), a range (`'45-53'`), or a comma separated mix of both (`'0, 8, 45-53'`), so one entry can fill several slots at once.
## Item Material
Every item in a menu takes a `material`, the pagination arrows, the decorative fillers and the available keys item included. Alongside vanilla materials it accepts the same [hooked values](reward-config-editing.md#hooked-materials) as a reward, so any of them can be a custom item from ItemsAdder, Nexo, CraftEngine, MMOItems, ExecutableItems, Mythic Items or HeadDatabase.
```yaml
pagination:
next-item:
slot: '26'
material: itemsadder:medieval_crates:next_arrow
custom-model-data: 0
item-model: ''
display-name: '&6Next page - Page %page%'
```
> **Danger:**
The parts of a hooked material are separated by colons, never dashes, and an ItemsAdder value keeps its namespace, so it has three parts. `itemsadder-medieval_crates-next_arrow` and `itemsadder:next_arrow` both fail.
Keep `custom-model-data` at 0 and `item-model` empty on a hooked material. Both are applied on top of whatever the hook returns and would override the model the custom item already carries. A 0 and an empty value are skipped, leaving the hook's own model alone.
An item rendering as a barrier means the material was accepted as a hooked value but nothing came back, either because the id is wrong or because the hooking plugin had not finished loading its items when the menu was built. A material rejected outright is logged as an unknown material on startup instead.
## Reward
The rewards are the items you offer in your crate. You can adjust their names, lore, and configure them as you wish. The selective reward option also includes a setting for a locked item, in case the reward has already been claimed. The reward slots will be based on the slots: that were set in the pagination
```yaml
reward:
name: '&7%reward_name%'
lore:
- '%reward_lore%'
- ''
- '&eYour percentage: &6%percentage%%'
- '&eYour chance: &6%chance%%'
- ''
- '&7Check our &6&lWIKI &7to understand the difference'
- '&7between percentage and chance.'
- ''
- '&7(This lore is configured at the menus folder)'
```
## Review & Reroll
These two items are found in the reroll menu. The review option allows you to claim the reward you won, while the reroll option lets you get another reward instead.
## Virtual Keys Menu
The menu behind `/crates virtualKeys` lives in menus/virtual\_keys.yml and is customized like any other, with its own settings, pagination and items. On top of those it has a `key-item` block, which is the entry rendered for each of the player's keys.
```yaml
key-item:
display-name: '&e%key_name%'
lore:
- '%item_lore%'
- ''
- '&fAmount: &e%amount%'
```
| Placeholder | Description |
| ------------ | -------------------------------------------- |
| %key\_name% | The key's display name. |
| %amount% | How many of that key the player has. |
| %item\_lore% | The lore of the key item itself. |
The item's material comes from the key, so it always looks like the real key.
> **Info:**
The menu only lists keys that are set to Virtual, are enabled, and that the player currently owns at least one of. A physical key never shows up here, and a key the player has none of is left out rather than shown as zero.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/configurations/customize-menus
---
# 🗂️ File Structure
## Overview
Everything the plugin writes lives in plugins/PhoenixCrates.
```
plugins/PhoenixCrates/
├── addons/
├── crates/
├── keys/
├── menus/
├── translations/
├── internal/
├── logs/
├── config.yml
├── locations.yml
├── internal_storage.yml
├── messages.yml
└── rarities.yml
```
## Folders
| Folder | Contents |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| **crates** | One file per crate. See [Crate Configuration File](crate-configuration-file.md). |
| **keys** | One file per key. |
| **menus** | The menu layouts. See [Customize Menus](customize-menus.md). |
| **addons** | Add-on jars. Drop a new add-on here and restart. |
| **translations** | The language files. See [Languages & Translations](languages.md). |
| **internal** | Plugin-managed working data. Never edit this by hand. |
| **logs** | Written by the logger. See [Log the Actions](../features/log-the-actions.md). |
## Files
| File | Contents |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- |
| **config.yml** | The main settings, the database connection and the license. See [Main Configuration](main-configuration.md). |
| **locations.yml** | Every crate placed in the world, with its coordinates and facing. See the note below. |
| **internal_storage.yml** | Items saved from the editor that are not tied to a single crate. |
| **messages.yml** | Legacy message file, kept for configurations made before translations were introduced. |
| **rarities.yml** | The rarities, when the Rarity add-on is installed. |
Installed add-ons add one file each: `crate-claim.yml`, `mass-opening.yml`, `ip-limit.yml`, `reward-on-loop.yml`, `redis.yml`, and `logger.yml` for the logger.
> **Warning:**
locations.yml is what makes a placed crate exist. Deleting it leaves every crate configured but no longer placed anywhere in the world.
## What Lives in the Database
Player progress is **not** in these files. Virtual keys, open cooldowns, opened counts, win limits and rerolls are all stored in the database configured in `config.yml`, which is SQLite (a file inside the plugin folder) by default and MySQL if you set it up.
## Moving to Another Server
To carry your setup across:
* **Configuration** - copy `crates/`, `keys/`, `menus/`, `translations/`, `config.yml`, `internal_storage.yml`, `rarities.yml` and the add-on files.
* **Placed crates** - copy `locations.yml`, but only if the worlds come across too. A location pointing at a world that does not exist is skipped.
* **Player progress** - point the new server at the same MySQL database, or copy the SQLite file across.
> **Danger:**
If you copy `config.yml` to a second server, remember that a license only allows a limited number of concurrent sessions. See [Licensing](../plugin-information/licensing.md).
## What to Back Up
The whole plugins/PhoenixCrates folder, plus your database if you use MySQL. The editor writes changes to these files as you make them, so a backup taken while the server runs is a valid one.
## Reporting a Problem
Turning on `debug` in `config.yml` adds verbose console logging and creates a debug\_output folder with extra diagnostics. Both are useful to attach when you report an issue to us.
Source: https://www.phoenixplugins.com/docs/phoenix-crates/configurations/file-structure
---
# 🛠️ GeyserMC (Bedrock)
## Overview
For Bedrock to work, the most common practice is to have a Java version with Geyser that allows Bedrock clients.
**Please note:** This guide will not cover the installation process of Geyser itself. Refer to the Geyser wiki for comprehensive installation instructions: [Geyser Wiki Setup](https://wiki.geysermc.org/geyser/setup/)
## Bedrock Forms
> **Info:**
These options are in the bedrock section of config.yml. They have no editor option.
Bedrock players can use the player menus as native Bedrock forms instead of chest menus. Forms need Floodgate or Geyser to be installed on the same server as the plugin. Without either, everyone gets the chest menus.
```yaml
bedrock:
forms: true
input-modes: []
allow-opt-out: true
resize-chest-menus: true
icons:
enabled: true
fallback-url: ""
head-url: "https://mc-heads.net/head/%texture%"
```
| Menu | Bedrock form |
| --- | --- |
| Rewards preview | A button per reward with its chance, or the keys it needs in selective crates. Tapping a reward shows its full description. Reward groups open their own list. |
| Reward selection | A button per reward with the keys it needs. Tapping an unlocked reward redeems it, a locked one shows why it is locked. |
| Confirmation | A confirm and a cancel button. |
| Reroll | A claim and a reroll button, or only claim when no rerolls are left. Closing the form claims the reward. |
| Virtual keys | A button per key with the amount owned. |
The preview and selection forms list the keys the player owns for that crate at the top. Buttons use the menu titles and the reward, key and button names of the menu files, with colors kept and hex colors removed, since forms cannot show them. The rest of the form text comes from the bedrock section of the translations file. Opening animations are not forms and look the same as on Java.
The [Key Shop](../add-ons/key-shop/README.md), [Crate Claim](../add-ons/crate-claim/README.md), [Milestones](../add-ons/milestones/README.md) and [Mass Opening](../add-ons/mass-opening/README.md) add-ons have forms for their player menus too, described on their pages.
Every other menu, the editor included, stays a chest menu. A button with several click actions asks Bedrock players which one to run, since Bedrock cannot Shift or right-click, and text input opens as a form.
If a form cannot be sent, the player gets the chest menu instead and the console says so.
### Forms
Turns Bedrock forms on or off for the whole server. When off, Bedrock players get the chest menus like everyone else.
### Input Modes
Limits forms to Bedrock players on certain devices, by their input mode: `TOUCH`, `CONTROLLER`, `KEYBOARD_MOUSE` or `VR`. Players on any other input get chest menus. Leave the list empty to give forms to every Bedrock player.
### Allow Opt Out
Lets Bedrock players choose chest menus for themselves. The preview, selection and virtual keys forms get a button to switch to chest menus, and `/crates forms` switches between the two. The choice is remembered per player. When this is off, every Bedrock player gets forms and the command is refused.
### Resize Chest Menus
Bedrock only draws chest menus of 3 or 6 rows cleanly. With this on, a player menu of 1 or 2 rows is opened with 3 rows and a menu of 4 or 5 rows with 6, for Bedrock players who get chest menus. Java players always see the rows the menu is set to.
### Icons
Adds an icon to form buttons.
* **enabled** - Turns icons on or off.
* **fallback-url** - An image URL for materials the built-in icon table does not know. `%material%` is replaced by the material name in lower case. Leave it empty for no icon.
* **head-url** - An image URL for player heads. `%texture%` is replaced by the head's texture id, or the owner's name when it has no texture. Leave it empty for no head icons.
Vanilla items use the Bedrock texture of the same item. Items with custom model data or an item model get no icon, since their texture only exists in a resource pack.
## Step by Step Guide
### Step 1: Install Geyser Optional Pack
The GeyserOptionalPack is a resource pack specifically designed for Bedrock Edition clients playing on Geyser servers. It adds features and bug fixes to bring the Bedrock experience closer to Java Edition, including improvements in model rendering.
A resource pack allows for additional features and bug fixes to be implemented within the limitations of Bedrock Edition.
You can download the GeyserOptionalPack from the official GitHub repository: [GeyserOptionalPack GitHub](https://github.com/GeyserMC/GeyserOptionalPack).
### Step 2: Convert Your Java Resource Pack to Bedrock
While some complex Java textures require manual conversion, this guide will focus on converting simpler models.
There are two main approaches depending on your source for the Java models:
#### 2.1 Using Kastle Java to Bedrock Converter:
We will be using Kas-tle's java2bedrock conversion tool available at this link: Kas-tle java2bedrock conversion.
**Here's how to convert your Java resource pack to Bedrock using java2bedrock.sh:**
**2.1.1 Convert the Java Model Engine Resource Pack (Optional):**
* Extract the `resource_pack.zip` file from `plugins/ModelEngine/resource_pack.zip`.
* Merge the extracted files with your other java resource packs (if needed) and proceed to the next step.
**2.1.2 Uploading Your Java Resource Pack:**
Unfortunately, in most cases, you won't have a direct URL for your Java resource pack. Here's a workaround using Dropbox:
1. Upload your Java resource pack to Dropbox.
2. Get a direct download link for the file. To do this, access the file in Dropbox and click the "..." menu. Then, select "Share" and copy the link.
3. **Important:** Append "\&dl=1" to the end of the copied URL. This enables direct downloading.
**2.1.3 Generate Bedrock Resource Pack:**
* Visit the java2bedrock.sh conversion link ([Kas-tle java2bedrock conversion](https://github.com/Kas-tle/java2bedrock.sh/issues/new?assignees=\&labels=conversion\&template=pack-conversion.yml\&title=%5BPack%5D%3A+)).
* Paste your modified Dropbox download URL (with "\&dl=1") into the "Java Pack Direct Download URL" option.
* Follow the converter's instructions to complete the conversion process.
* Click on "Submit new issue" to initiate the conversion.
* Wait for the conversion to be over
**2.1.4 Using the Converted Resource Pack:**
* Once the conversion is complete, download the generated Bedrock resource pack.
* Place the converted Bedrock resource pack in the `Geyser > packs` folder on your server.
* Place the file `geyser_mappings.json` file in the `Geyser > custom_mappings` folder on your server.
## Bedrock Skull Textures
Bedrock cannot load player head textures on its own, so opening animations that use heads need every head registered in Geyser's `skin-hashes` option, following the [Geyser custom skulls guide](https://geysermc.org/wiki/geyser/custom-skulls/). Add the part of each link after `http://textures.minecraft.net/texture/`.
Christmas Crate Animations add-on
| Animation | Heads |
| --- | --- |
| Santa Claus | [Santa](http://textures.minecraft.net/texture/14e424b1676feec3a3f8ebade9e7d6a6f71f7756a869f36f7df0fc182d436e), [Kid](http://textures.minecraft.net/texture/5c8d3e33cb1ca1aacf9dad322f4f7519cd7dfa509c33b7dd87b5398ee0ac17a8) |
| Elf | [Present](http://textures.minecraft.net/texture/45368f5635ff6c3407f0f356c5b6e0947bcd5e38490c9aa8b8b582a4f21ae3cb), [TV](http://textures.minecraft.net/texture/7bbe8fd1aa39f15076e884dfe6ddb9a3f3761db31e2b1f9940b5dfd34d1c4d), [Elf](http://textures.minecraft.net/texture/4ec5455f43426ca1874b5c7b4a492ec3722a502f8b9599e758e133fed8b3c1e4) |
| Christmas Tree | [Ornament](http://textures.minecraft.net/texture/2db24dc262631663ba1e3e3398645013dc5cd2331ec9b9f3eb26855a0b104baa) |
| Presents, every animation | [White](http://textures.minecraft.net/texture/e47b37e67a89159bf4acc4a44d4328f4efc0181605142288e5eed1ab8aed913c), [Green](http://textures.minecraft.net/texture/28dc3c84491c4ff103de6ea01880e2d83432cd4878b84d6b43253cc51fd978e7), [Blue](http://textures.minecraft.net/texture/5b85e29f29ec9a90e482ea5b8391bcb4560bbae0dcd15d7ce1d86016b4356e98), [Purple](http://textures.minecraft.net/texture/e9e39d91c04c30cc1f530fee798eed279dde60f95c2e1d155c0fdd361d0962ed), [Yellow](http://textures.minecraft.net/texture/abd98792dd92d9719894341ac9012a584c4428558fd2c712f78e5f0d4da85470), [Red](http://textures.minecraft.net/texture/45368f5635ff6c3407f0f356c5b6e0947bcd5e38490c9aa8b8b582a4f21ae3cb) |
| Ornaments, every animation | [Red](http://textures.minecraft.net/texture/c6f518cdcc30da6e21833f3d90366c3703c27a0170b928fb15b5e51816f4e15e), [Orange](http://textures.minecraft.net/texture/ad53ec557eca3c5a08be794164b2e9b6a7fb703a33388f0a9c02c3b16c2945e4), [Yellow](http://textures.minecraft.net/texture/c0dac2501c9e756767f6943323ad5955b5a975bb09be12364ef80ea3f1ca7b06), [Lime](http://textures.minecraft.net/texture/9b68ca27a304d21e2e8a99a748093f95ae5b148c59d7af0b5670f1d15202502e), [Green](http://textures.minecraft.net/texture/41e7340dd4c009c43c398bc40d9aed147014057a7f43722c6cdc9b45837015f5), [Dark Green](http://textures.minecraft.net/texture/b605c66347f327c5eed27672d7a0e347f4e36c006353c91b78935ba28116504), [Dark Aqua](http://textures.minecraft.net/texture/623323728e9df5c38053176465da1f4c855cd6a3a5f3928a223150e680441a8f), [Dark Blue](http://textures.minecraft.net/texture/86f901bbde8cd67520fa0c7ae461ee7ca66ce3c4c481cd5c12fb43712eea6b63), [Aqua](http://textures.minecraft.net/texture/29273cb3c79ecd53c13b4d71e9afd919d1dcba1410c2538b8fe099ecd61a6cb4), [Very Dark Blue](http://textures.minecraft.net/texture/17f85d2edc530c4f33a35c7cccefea9528812137ae13e040e1169032b4f39c53), [Purple](http://textures.minecraft.net/texture/431d901ceeb38d0f9c63ae66cd5a46e33a09c0349d383f5a5c7c3726e0e0e371), [Magenta](http://textures.minecraft.net/texture/94b3aed343afb22d536ca60cf95e56cf334c68bc41b1369ec9b06f4dd050e6cb), [Pink](http://textures.minecraft.net/texture/87f5c30a117ee8ae80c7858ac42c67b2bbe5e600a60ceeaa2817f862dd89333d) |
Source: https://www.phoenixplugins.com/docs/phoenix-crates/configurations/geysermc-bedrock
---
# 🖼️ In-Game Menu Editor
> **Info:**
Available in the Premium+ plan of Phoenix Crates.
The editor changes the same menu files described in [Customize Menus](customize-menus.md). A menu saved in-game is live straight away, with no reload.
## Opening the Editor
There are two ways in, both needing phoenixcrates.command.editor:
Editor (Menu Layouts)
Menu Layouts (Default Rewards Preview)
* **Editor > Menu Layouts** lists every menu file by its name. Left-click one to edit it.
* /crates editLayout \