User Guide

Complete guide for Minecraft server administrators to configure and use the zCrates plugin.

Installation

  1. Download the zCrates.jar file

  2. Place it in your server's plugins/ folder

  3. Restart the server

  4. 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 material or copy-from must be specified (not both)

  • When using copy-from, you can still override display-name, lore, item-name, and amount

  • The 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-from creates the base item from the plugin first

  • Your 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 equality

  • NOT_EQUALS - String or numeric inequality

  • GREATER_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 numbers

  • Common formatting characters (commas, spaces) are automatically removed during parsing

  • If parsing fails for numeric comparisons, the condition returns false

  • For EQUALS and NOT_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 speed

  • EASE_IN - Starts slow, accelerates

  • EASE_OUT - Starts fast, decelerates

  • EASE_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:

Type
Description
Example

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

Command
Description
Permission

/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 reload

  • crates.command.open - Access to /zcrates open

  • crates.command.give - Access to /zcrates give

  • crates.command.place - Access to /zcrates place

  • crates.command.remove - Access to /zcrates remove

  • crates.command.purge - Access to /zcrates purge

  • crates.command.animations - Access to animation commands

Crate Permissions

Defined in crate conditions:


Hooks & Integrations

PlaceholderAPI

Available placeholders:

Placeholder
Description

%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?

  1. Check console for errors

  2. Make sure the YAML file is valid

  3. Verify the referenced animation exists

  4. Use /zcrates reload after 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