User Guide
Complete guide for Minecraft server administrators to configure and use the zCrates plugin.
Installation
Download the
zCrates.jarfilePlace it in your server's
plugins/folderRestart the server
Configuration files will be generated automatically
Requirements
Minecraft: 1.21+
Server: Paper/Purpur
Java: 21+
Dependencies: zMenu (bundled)
Basic Configuration
config.yml
# Enable debug messages
debug: false
# Database configuration
database:
type: SQLITE # SQLITE, MYSQL, or MARIADB
table-prefix: "zcrates_"
# For MySQL/MariaDB only
host: "localhost"
port: 3306
database: "minecraft"
username: "root"
password: ""messages.yml
Customize all plugin messages:
Creating a Crate
Create a file in plugins/zCrates/crates/. Example: legendary.yml
Key Types
Virtual Key (VIRTUAL)
Stored in database, no physical item.
Physical Key (PHYSIC)
Item in player's inventory.
Reward Types
ITEM - Single item
ITEMS - Multiple items
COMMAND - Single command
COMMANDS - Multiple commands
ItemStack Configuration with Delegates
The ItemStackWrapper system allows you to configure items in two ways: direct material specification or delegation to custom item plugins. This is used throughout the plugin for reward items, display items, and physical keys.
Direct Material Specification
Define items using vanilla Minecraft materials:
Delegate System (copy-from)
The delegate system allows you to reference items from custom item plugins using the copy-from parameter. This creates a base item from the plugin, which you can then customize with additional properties.
Structure:
Important Notes:
Either
materialorcopy-frommust be specified (not both)When using
copy-from, you can still overridedisplay-name,lore,item-name, andamountThe delegate retrieves the base item from the plugin, then applies your customizations
If the item provider returns null, an error will be thrown
Available Delegates
The following custom item plugins are supported through the hook system:
ItemsAdder
Example:
Oraxen
Example:
Nexo
Example:
zItems
When the zItems hook is enabled, it registers itself as an ItemsAdder provider:
Example:
Complete Examples
Physical Key with Delegate
Item Reward with Multiple Customizations
Items List Reward with Mixed Sources
Troubleshooting
"No item provider found for plugin: X"
The hook for that plugin is not enabled
Make sure the target plugin is installed and loaded
Check console logs for hook loading status
"Item provider returned null for itemId: X"
The item ID doesn't exist in the target plugin
Check the spelling and namespace of the item ID
Verify the item exists using the target plugin's commands
Items have wrong properties
Remember that
copy-fromcreates the base item from the plugin firstYour customizations (display-name, lore, etc.) are applied after
Some properties might be overridden by the base item's NBT data
Opening Conditions
PERMISSION
Requires a permission to open the crate.
COOLDOWN
Wait time between openings (in milliseconds).
The cooldown is stored in the player's persistent data container (PDC).
PLACEHOLDER
Checks a PlaceholderAPI placeholder value with flexible comparison types. Requires the PlaceholderAPI hook to be enabled.
Comparison Types:
EQUALS- String or numeric equalityNOT_EQUALS- String or numeric inequalityGREATER_THAN- Numeric comparison (>)LESS_THAN- Numeric comparison (<)GREATER_THAN_OR_EQUALS- Numeric comparison (>=)LESS_THAN_OR_EQUALS- Numeric comparison (<=)
Basic Examples:
Advanced Examples:
Notes:
When using numeric comparisons (
GREATER_THAN,LESS_THAN, etc.), the plugin automatically parses both values as numbersCommon formatting characters (commas, spaces) are automatically removed during parsing
If parsing fails for numeric comparisons, the condition returns
falseFor
EQUALSandNOT_EQUALS, if numeric parsing fails, string comparison is used as fallback (case-insensitive)
Combining conditions
Animations
Animations are defined in JavaScript in plugins/zCrates/animations/.
Included Animation: Roulette
File: animations/roulette.js
Creates a classic roulette effect in the menu.
Creating a Custom Animation
Available Speed Curves
LINEAR- Constant speedEASE_IN- Starts slow, acceleratesEASE_OUT- Starts fast, deceleratesEASE_IN_OUT- Slow → Fast → Slow
Selection Algorithms
Algorithms determine how rewards are selected.
Included Algorithm: Weighted
File: algorithms/weighted.js
Selection based on reward weights.
Creating a Custom Algorithm
Placing Crates
Via Command
Display Types:
BLOCK
Placed block
CHEST, ENDER_CHEST
ENTITY
Spawned entity
ARMOR_STAND, ZOMBIE
MYTHIC_MOB
MythicMobs entity
MyMob
ITEMS_ADDER
ItemsAdder furniture
custom:my_crate
NEXO
Nexo furniture
nexo:crate
ORAXEN
Oraxen furniture
oraxen:crate
Examples
Removing a Placed Crate
Look at the crate and type:
Removing All Crates in a World
Commands
/zcrates reload
Reload configurations
crates.command.reload
/zcrates open <player> <crate> [force]
Open a crate for a player
crates.command.open
/zcrates give <player> <crate> <amount>
Give keys
crates.command.give
/zcrates place <crate> <type> [value]
Place a crate
crates.command.place
/zcrates remove
Remove a placed crate
crates.command.remove
/zcrates purge
Remove all placed crates
crates.command.purge
/zcrates animations debug
Debug animations
crates.command.animations
Permissions
Command Permissions
crates.command.reload- Access to /zcrates reloadcrates.command.open- Access to /zcrates opencrates.command.give- Access to /zcrates givecrates.command.place- Access to /zcrates placecrates.command.remove- Access to /zcrates removecrates.command.purge- Access to /zcrates purgecrates.command.animations- Access to animation commands
Crate Permissions
Defined in crate conditions:
Hooks & Integrations
PlaceholderAPI
Available placeholders:
%zcrates_keys_<crate-id>%
Number of keys for a crate
%zcrates_openings_<crate-id>%
Total openings count
%zcrates_last_reward_<crate-id>%
Last reward won
MythicMobs
Use MythicMobs mobs as crate displays:
ItemsAdder / Nexo / Oraxen
Use custom furnitures as crates:
FAQ
How do I see a crate's rewards?
Left-click on a placed crate to open the preview.
How does reroll work?
After the animation, if max-rerolls > 0, a reroll button appears. The player can restart the animation for a new reward.
Are virtual keys persisted?
Yes, they are stored in the database (SQLite by default).
How do I give keys via command?
How do I force open without a key?
Why isn't my crate loading?
Check console for errors
Make sure the YAML file is valid
Verify the referenced animation exists
Use
/zcrates reloadafter changes
How do I create a custom menu?
Create a file in plugins/zCrates/inventories/ following the zMenu format. Reference it with related-menu in your crate.
Support
Discord: [https://discord.gg/PTSYTC53d3]
GitHub Issues: [https://github.com/GroupeZ-dev/zCrates/issues]
API Documentation: See
API_REFERENCE.md
Last updated