CodeRedeem

Plugin for Redeem Code

1,38k

CodeRedeem

CodeRedeem by SkyX

CodeRedeem

CodeRedeem allows you to create random coupon codes for players to redeem specific rewards.

Features

- The reward system is fully customizable, allowing you to define what command should be executed for each type of code specified in the configuration. You can set up redemption codes according to your preferences in the folder resources. - Make sure to modify the codes, and rewards without needing to restart the server (auto-save).

Usage

- Usage to redeem for player ``` /redeem <Code> ``` - Usage for OP and consol

command

Warning

However, keep in mind that manually editing the data.yml file is not recommended.

config.yml

config.yml

```

Selec Language

language: en_US

Economy

economy:

use-vault: true

Advance Setting

additional-settings:

example-setting: "value"

```

To be honest, in config.yml it is only for setting the language. For other settings, it seems that there is no need to change them.

example_code.yml

This file is located in the codes folder.

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

This file is located in the language folder.

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 <code>" usage_redeem: "Usage: /redeem <code>" 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 <code>" usage_disable_code: "Usage: /cr disable <code>" 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>

code_info_header: "Code INFORMATION" status: "Status" code: "Code" validity_date: "Valid to" redeem_limit: "Redeem Limit" redeem_count: "Redeem Count" file: "File Name" ```

ADS