Skip to main content

Configuration

CocoVouchers uses multiple configuration files for flexibility and organization.

Main Configuration (config.yml)โ€‹

prefix: "&8[&#08ACFBC&#07A8F5o&#07A3EFc&#069FE9o&#059BE3V&#0496DDo&#0492D6u&#038DD0c&#0289CAh&#0185C4e&#0180BEr&#007CB8s&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[&#08ACFBC&#07A8F5o&#07A3EFc&#069FE9o&#059BE3V&#0496DDo&#0492D6u&#038DD0c&#0289CAh&#0185C4e&#0180BEr&#007CB8s&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 with cocovouchers.cooldown.bypass skip 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
OptionDescription
materialBukkit material name
nameDisplay name with colors
custom-model-dataFor resource packs
max-stackMaximum stack size (1-64)
loreItem lore lines
enchantmentsList of ENCHANT:LEVEL
hide-attributesHide item flags

Click Typesโ€‹

Configure which click activates the voucher:

TypeDescription
RIGHTRight-click
LEFTLeft-click
SHIFT_RIGHTShift + Right-click
SHIFT_LEFTShift + Left-click
click-type: "RIGHT"

Confirmation Systemโ€‹

Require double-click to prevent accidental use:

confirm:
enabled: true
timeout: 30
  • enabled - Require confirmation click
  • timeout - 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