VoucherZ

About

This resource allows to create codes that can be redeemed. Each code can execute unlimited commands.

Category

  • Miscellaneous

Commands

Name Alias Description Since
/voucherz None Basic plugin information. 1.0.0
/voucher None Create and/or deleted vouchers. Add and/or remove commands from vouchers. 1.0.0
/redeem [Code] None Validate code and execute commands if valid. 1.0.0

Permissions

Permission Node Description Since
VoucherZ.* Access to all commands of the plugin 1.0.0
VoucherZ.command.delete Access to /voucher delete 1.0.0
VoucherZ.command.command Access to /voucher command 1.0.0
VoucherZ.command.create Access to /voucher create 1.0.0
VoucherZ.command.redeem Access to /redeem 1.0.0
VoucherZ.command.redeem.[Code] Access to /redeem if custom permission is set to true 1.0.0

Developer API

You can find all methods with their documentation in the at.rengobli.voucherz.code.VoucherCodeManager.java class. The main instance of this plugin is called at.rengobli.voucherz.VoucherZ.java.

Methods (VoucherCodeManager.java)
Name Type Description Parameter Return Since
getByName(); VoucherCode Get a VoucherCode Object by its name String name VoucherCode 1.0.0
getByCode(); VoucherCode Get a VoucherCode Object by its code String code VoucherCode 1.0.0
isValid(); boolean Validate a code String code If the code is valid 1.0.0
Object VoucherCode.java
Name Type Parameter Return Since
getName(); String N/A String name 1.0.0
hasPermission(); boolean N/A If you need permission VoucherZ.command.redeem to access this code 1.0.0
hasCustomPermission(); boolean N/A If you need permission VoucherZ.command.redeem.[Code] to access this code 1.0.0
getUses(); Integer N/A How often this code has been used 1.0.0
increaseUses(); void N/A N/A 1.0.0
getMaxUses(); Integer N/A How often this code can be used 1.0.0
getValidUntil(); long N/A Timestamp how long the code is valid 1.0.0
getValidationDate(); String N/A Timestamp formated by value set in config.yml 1.0.0
getCode(); String N/A The code you need to redeem 1.0.0
getCommands(); List<String> N/A The commands that shell be executed 1.0.0
addCommand(String cmd); void N/A N/A 1.0.0
removeCommand(String cmd); void N/A N/A 1.0.0

File Configuration: config.yml

Settings

date_format
Choose the way that <date> is displayed by validation timestamp.
default: YYYY-MM-dd HH:mm:ss
delete_after_expire
Auto remove codes when they expire.
default: true
delete_after_max_use
Auto remove codes when they reach their maximum amount of uses.
default: true

Debug mode for error handling

debug
If the plugin does not work as intended, try to figure out the problem with this mode before contacting the developer.
default: false