```
- 用于 OP 和控制台

## **警告**
但是,请注意,手动编辑 data.yml 文件不推荐。
## **config.yml**
config.yml
```
# Selec Language
language: en_US
# Economy
economy:
use-vault: true
# Advance Setting
additional-settings:
example-setting: "value"
```
说实话,在 config.yml 中它仅用于设置语言。对于其他设置,似乎不需要更改它们。
## **example_code.yml**
此文件位于 codes 文件夹中。
example_code.yml
```
# REDEEM CODE (use only capital letters and numbers)
code: REDEEMCODE123
# Enable or disable the code
enabled: false
# Validity date in yyyyMMdd format
validity: 20241231
# Rewards configuration
# Reference to the book YAML file in writtenbook folder
# level enhantment 1-100
# Command must be valid
rewards:
- book: great_tale
custom_name: "&6The Great &cTale"
count: 1
- item: DIAMOND_SWORD
custom_name: "&cFire &6Sword"
count: 1
enchantments:
- type: FIRE_ASPECT
level: 100
- type: UNBREAKING
level: 100
- item: GOLDEN_APPLE
count: 5
- money: 1000
- command: give {player} minecraft:diamond_sword
message: "&x&0&8&4&C&F&BY&x&0&D&5&1&F&Bo&x&1&2&5&6&F&Bu &x&1&C&6&0&F&Bh&x&2&1&6&5&F&Ba&x&2&6&6&A&F&Bv&x&2&B&6&F&F&Be &x&3&5&7&A&F&Cr&x&3&A&7&F&F&Ce&x&3&F&8&4&F&Cc&x&4&4&8&9&F&Ce&x&4&9&8&E&F&Ci&x&4&E&9&3&F&Cv&x&5&3&9&8&F&Ce&x&5&8&9&D&F&Cd &x&6&2&A&7&F&CL&x&6&7&A&C&F&Ce&x&6&C&B&1&F&Cg&x&7&1&B&6&F&Ce&x&7&6&B&B&F&Cn&x&7&B&C&0&F&Cd&x&8&0&C&5&F&Ca&x&8&5&C&B&F&Dr&x&8&A&D&0&F&Dy &x&9&4&D&A&F&DW&x&9&9&D&F&F&De&x&9&E&E&4&F&Da&x&A&3&E&9&F&Dp&x&A&8&E&E&F&Do&x&A&D&F&3&F&Dn"
# Optional: Define how many times the code can be redeemed
# Use -1 for unlimited
redeem_limit: 10
#dont change this
redeem_count: 0
```
## **en_US.yml**
此文件位于 language 文件夹中。
en_US.yml
```
version: 1.0.1
# Set your langue in this
already_redeemed: "You have already redeemed this code."
book_received: "You have received the book {title}."
code_expired: "This code has expired."
code_not_available: "Code not available."
empty_book: "The book {bookName} is empty."
error_creating_book: "There was an error creating the book: {bookName}."
error_parsing_date: "Error parsing the expiration date."
error_loading_code: "Codes folder does not exist or is not a directory."
error_processing_reward: "There was an error processing one or more rewards."
invalid_book_reference: "The book reference {bookName} is invalid or does not exist."
invalid_code: "The code you provided is invalid or does not exist."
invalid_date_format: "The date format in the code configuration is invalid."
invalid_enchantment: "Invalid enchantment: {enchantmentName}. Please check the enchantment name."
invalid_item_material: "Invalid item material: {itemName}. Please check the item name."
invalid_reward_format: "The reward format is invalid."
invalid_subcommand: "Invalid subcommand. Use /cr help for a list of commands."
money_received: "You have received ${money}"
no_permission: "You do not have permission to use this command."
only_players: "This command can only be used by players."
plugin_reloaded: "The plugin has been reloaded successfully."
redeem_limit_reached: "The redeem limit for this code has been reached."
redeem_successful: "You have successfully redeemed the code!"
reloaded: "Plugin configuration and language reloaded successfully."
usage_subcommand: "Usage: /cr {subCommand}"
usage_info: "Usage: /cr info "
usage_redeem: "Usage: /redeem "
warning_throw_book: "This written book cannot be discarded."
message_received_reward: "You have received {count} {itemName}s."
inalid_number_format_for_length: "Invalid number format for length."
invalid_length: "Length must be between 6 and 16."
invalid_code_length: "Code must be beween 6 and 16 character"
success_create_code: "File created and modified successfully. New file: "
failed_create_code: "Failed to save the new file."
code_not_found_in_data: "Code not found in data"
code_refreshed: "The code was successfully refreshed"
failed_refresh_code: "The code failed to refresh"
op_only: "You must be an operator to use this command."
hold_written_book: "You must be holding a Written Book."
invalid_book: "The item in your hand is not a valid written book."
no_title: "The written book must have a title."
file_exists: "A file with this title already exists. Choose a different title."
save_success: "The book has been successfully saved as {fileName}."
save_error: "An error occurred while saving the book."
usage_enable_code: "Usage: /cr enable "
usage_disable_code: "Usage: /cr disable "
code_enabled_successfully: "The code has been enabled successfully."
code_disabled_successfully: "The code has been disabled successfully."
error_saving_file: "An error occurred while saving the file."
invalid_redeem_code: "Invalid redeem code. Please contact the administrator."
error_enable_code: "Failed to enable code. Because the code has been enabled"
error_disable_code: "Failed to disable code. Because the code has been disable"
# translate for /cr info
code_info_header: "Code INFORMATION"
status: "Status"
code: "Code"
validity_date: "Valid to"
redeem_limit: "Redeem Limit"
redeem_count: "Redeem Count"
file: "File Name"
```

# **CodeRedeem**
CodeRedeem 允许您创建随机优惠券代码,供玩家兑换特定奖励。
## **功能**
- 奖励系统完全可定制,允许您定义在配置中指定的每种代码类型应执行哪个命令。您可以在 resources 文件夹中设置兑换代码,以满足您的偏好。
- 无需重启服务器即可修改代码和奖励 (自动保存)。
## **用法**
- 用于玩家兑换
```
/redeem