Menu

Usage Guide

Follow these steps to create and configure crates with the CCrates plugin.


Step 1: Create a Crate

To create a crate, add a .yml file inside the crates folder within the plugin directory.

In the config.yml, specify the internal crate name and its file path like this:

examplecrate: "examplecrate.yml"

Step 2: Configure Your Crate

Each crate needs the following:

Each prize can include both items and commands. For commands, you can use placeholders like:

Step 3: More Information

For more information, visit the Crates page or check the example file generated when the plugin is first run.

Configuration Explanation

# DO NOT edit this line, it's for internal purposes
plugin-version: "${version}"  # The version of the plugin

# OFF, LOW, MEDIUM, HIGH
log-level: "HIGH"  # Set the log level (controls how much info is logged)

language: "en"  # The language of the plugin (files are located in messages folder)

dictation-hook: true  # Whether the Dictation hook is enabled

update-check: true  # Whether to check for plugin updates

# Database configuration (sqlite or mysql)
database:
  type: "sqlite"  # Use either "sqlite" or "mysql" for database type
  database-name: "storage"  # The name of the database
  ip-address: "localhost"  # The IP address for MySQL (not needed for SQLite)
  port: 3306  # Port for MySQL database
  user: "root"  # Username for MySQL
  password: ""  # Password for MySQL
  table-name: crates  # The name of the table storing crate data

# Redis configuration
redis:
  server-name: global  # Unique name for your server
  enable: false  # Whether Redis is enabled
  host: "localhost"  # Redis host
  port: 6379  # Redis port
  username: "username"  # Redis username
  password: "password"  # Redis password
  channel-name: "ccrates-broadcast"  # Channel for broadcasting messages via Redis

# Database and Redis configuration section are ignored 
# when Dictation is present and hooked on the server 

# Rarity configuration
rarity:
  common: 1.0  # Common prize chance multiplier
  uncommon: 0.7  # Uncommon prize chance multiplier
  rare: 0.5  # Rare prize chance multiplier
  epic: 0.2  # Epic prize chance multiplier
  legendary: 0.1  # Legendary prize chance multiplier

legendary-multiplier: 1  # Multiplier for legendary prize chances
give-virtual-key-if-full-inv: true  # Give a virtual key if the player’s inventory is full
cache-saving-interval: 300  # Interval where all caches are pushed to the database

deal-knockback-on-no-key: true  # Whether to deal knockback if the player doesn’t have a key
protect-model-engine-entities: true  # Whether to protect ModelEngine entities
require-holding-key: true  # Whether players must hold the crate key to open it

# Sound configuration
sounds:
  no-key:
    enable: true  # Whether the "no-key" sound is enabled
    sound: "entity.villager.no"  # The sound that plays when the player doesn’t have a key
    volume: 1  # Volume of the sound
    pitch: 1  # Pitch of the sound

# Fallback prize icon configuration
fallback-prize-icon:
  material: PAPER  # The material of the fallback prize icon
  display-name: "&bMysterious Price"  # Display name of the fallback prize
  glow: true  # Whether the fallback prize icon should glow
  lore:
    - "&7This price does not contain items."  # Lore for the fallback prize icon
    - "&7It may contains commands or something else... who knows..."  # Additional lore

# Crates mapping to yml files
crates:
  examplecrate: "examplecrate.yml"  # Mapping for a crate, pointing to its .yml file