Configuration
CocoVouchers uses multiple configuration files for flexibility and organization.
Main Configuration (config.yml)โ
prefix: "&8[ACFBCA8F5oA3EFcEFE9o;BE3VǰDDoǬD6u&DD0cġCAh¹C4e´BErCB8s&8] &7ยป"
language-file: "messages_en.yml"
# Cooldown settings
cooldown:
bypass-permission-enabled: true
database:
enabled: true
type: "sqlite" # sqlite, mysql
prefix: "cocovouchers_"
mysql:
host: "localhost"
port: 3306
database: "cocovouchers"
username: "root"
password: ""
config-version: 1
Configuration Optionsโ
prefixโ
The prefix used in all plugin messages. Supports hex colors!
prefix: "&8[ACFBCA8F5oA3EFcEFE9o;BE3VǰDDoǬD6u&DD0cġCAh¹C4e´BErCB8s&8] &7ยป"
language-fileโ
The language file to use from the locale/ folder.
language-file: "messages_en.yml"
cooldownโ
Cooldown system settings:
cooldown:
bypass-permission-enabled: true
bypass-permission-enabled- If true, players withcocovouchers.cooldown.bypassskip cooldowns
databaseโ
Database configuration for storing cooldown data:
database:
enabled: true
type: "sqlite" # sqlite, mysql
prefix: "cocovouchers_"
SQLite (Default):
- No additional configuration needed
- Data stored in
plugins/CocoVouchers/data.db
MySQL:
database:
enabled: true
type: "mysql"
prefix: "cocovouchers_"
mysql:
host: "localhost"
port: 3306
database: "cocovouchers"
username: "root"
password: "your_password"
Voucher Configurationโ
Each voucher is a separate YAML file in the vouchers/ folder.
Basic Structureโ
# Click type required (RIGHT, LEFT, SHIFT_RIGHT, SHIFT_LEFT)
click-type: "RIGHT"
# Unique voucher name
name: template
# Cooldown in seconds (0 = disabled)
cooldown: 60
# Confirmation settings
confirm:
enabled: true
timeout: 30
# Item appearance
item:
material: "PAPER"
name: "&6&lExample Voucher"
custom-model-data: 1001
max-stack: 64
lore:
- "&7Right-click to redeem!"
enchantments:
- "DURABILITY:1"
hide-attributes: true
# Usage requirements
requirements:
- "[PERMISSION] cocovouchers.use.example"
# Actions to execute
actions:
- "[MESSAGE] &aYou redeemed the voucher!"
- "[CONSOLE] give %player% diamond 64"
# Chance-based actions
chance-actions:
- chance: 50
actions:
- "[MESSAGE] &eRare reward!"
# Random weighted actions
random-actions:
- amount: 1
actions:
- "[MESSAGE] {10} Reward 1"
- "[MESSAGE] {90} Reward 2"
# Custom messages
messages:
success: "&aSuccessfully used!"
failure: "&cCannot use this voucher!"
# Crafting recipe
crafting:
enabled: false
output-amount: 1
permission: "cocovouchers.craft.template"
shape:
- "BAB"
- "ABA"
- "BAB"
ingredients:
A: "STONE"
B: "AIR"
Item Configurationโ
Configure the voucher item appearance:
item:
material: "PAPER"
name: "&6&lVIP Voucher"
custom-model-data: 1001
max-stack: 64
lore:
- "&7Click to claim VIP rank!"
- ""
- "&eRewards:"
- "&7โข VIP Rank"
- "&7โข 1000 Coins"
enchantments:
- "DURABILITY:1"
- "MENDING:1"
hide-attributes: true
| Option | Description |
|---|---|
material | Bukkit material name |
name | Display name with colors |
custom-model-data | For resource packs |
max-stack | Maximum stack size (1-64) |
lore | Item lore lines |
enchantments | List of ENCHANT:LEVEL |
hide-attributes | Hide item flags |
Click Typesโ
Configure which click activates the voucher:
| Type | Description |
|---|---|
RIGHT | Right-click |
LEFT | Left-click |
SHIFT_RIGHT | Shift + Right-click |
SHIFT_LEFT | Shift + Left-click |
click-type: "RIGHT"
Confirmation Systemโ
Require double-click to prevent accidental use:
confirm:
enabled: true
timeout: 30
enabled- Require confirmation clicktimeout- Seconds to click again before timeout
Color Codesโ
CocoVouchers supports:
Legacy Codes: &a, &b, &c, etc.
Hex Colors: &#RRGGBB or &#RGB
Gradient Example:
&#FF0000H&#FF4400e&#FF8800l&#FFCC00l&#FFFF00o