Перейти к содержимому
Mineforgian

MPromoCodes

Simple, powerful & Folia-ready promo code system for Minecraft servers

Загрузки
306
Подписчики
2
Обновлён
13 мая 2026 г.
Лицензия
All-Rights-Reserved

Опубликован 15 декабря 2025 г.

MPromoCodes

Simple, powerful & Folia-ready promo code system for Minecraft servers

MPromoCodes is a lightweight yet flexible promo code plugin that allows players to redeem reward codes using a simple command. It supports fully configurable rewards, conditions, Discord webhook logs, separated promo code files and multiple storage types including YAML, SQLite and MySQL.

All rewards are executed safely on Bukkit, Spigot, Paper, Purpur and Folia servers.


✨ Features

  • Redeem promo codes using /code
  • Promo codes are stored in a separate codes.yml file
  • Fully configurable rewards
  • In-Game Admin Menu
  • Supports console and player command execution
  • Built-in message system using message:
  • Optional Title & Subtitle messages after successful redemption
  • Per-player code usage
  • One-time codes and multi-use codes
  • Global use limits
  • Per-player use limits
  • Code cooldown support
  • 20+ Conditions for many different use cases
  • Supports start-date and expiry-date codes
  • Permission-based code access
  • Configurable code input rules
  • Case-insensitive code support
  • Configurable minimum and maximum code length
  • Anti-spam protection for failed redeem attempts
  • Discord webhook integration
  • Webhook logs for successful and failed redemptions
  • /codes webhook test command
  • Storage support:
    • YAML
    • SQLite
    • MySQL
  • Automatic migration from old config.yml codes to codes.yml
  • Automatic migration from YAML redeemed data to SQL storage
  • Safe async execution using a custom TaskManager
  • Folia-compatible execution
  • Clean and organized configuration

🧾 Example Code Configuration

Promo codes are now stored in codes.yml.

codes:
  WELCOME:
    enabled: true
    once-per-player: true
    global-use: 3
    per-player-use-limit: -1
    cooldown: ""
    permission-required: ""
    start-date: "25/12/2025 00:00"
    expiry-date: "31/12/2025 23:59"

    title:
      enabled: true
      main: "&aCode Redeemed!"
      sub: "&7You used: &fWELCOME"
      fade-in: 10
      stay: 40
      fade-out: 10

    commands:
      - "console: give %player% diamond 2"
      - "message: &aYou have successfully redeemed the &fWELCOME &acode!"

⚙️ Example Plugin Settings

General plugin settings are stored in config.yml.

settings:
  enabled: true
  server-name: "survival"
  debug: false
  case-insensitive-codes: true
  trim-code-input: true
  min-code-length: 2
  max-code-length: 32
  use-permission: "mpromocodes.use"

anti-spam:
  enabled: true
  failed-attempt-cooldown: "3s"
  max-failed-attempts: 5
  block-time: "1m"
  reset-on-success: true
  webhook-log-blocked-attempts: true

storage:
  type: "SQLITE"
  auto-migrate-yaml: true

  sqlite:
    file: "storage.db"

  mysql:
    host: "localhost"
    port: 3306
    database: "mpromocodes"
    username: "root"
    password: "password"
    use-ssl: false
    table-prefix: "mpromocodes_"

🔗 Discord Webhook Integration

MPromoCodes can send detailed logs directly to your Discord staff channel.

Webhook logs can include:

  • Successful code redemptions
  • Failed redemption attempts
  • Invalid codes
  • Expired codes
  • Already used codes
  • Missing permissions
  • Global limit reached
  • Conditions not met

You can also test your webhook directly in-game:

/codes webhook test

Webhook embeds support configurable colors, username, avatar, footer and mention protection.


🗄 Storage System

MPromoCodes supports multiple storage backends:

  • YAML — simple file-based storage
  • SQLite — recommended for most single-server setups
  • MySQL — recommended for larger setups and database-based storage

Existing redeemed.yml data can be automatically migrated to SQLite or MySQL when enabled.

storage:
  type: "SQLITE"
  auto-migrate-yaml: true

🔄 Automatic Migration

When updating from an older version, MPromoCodes can automatically move existing promo codes from config.yml to the new codes.yml file.

On first startup after updating:

  • Existing codes: from config.yml are moved to codes.yml
  • The old config is backed up as config-old.yml
  • A fresh config.yml is generated
  • Existing redeemed data can be migrated to SQLite or MySQL

This keeps old setups safe while allowing the plugin to use the new cleaner file structure.


🛡 Anti-Spam Protection

MPromoCodes includes built-in anti-spam protection for failed redeem attempts.

You can configure:

  • Failed attempt cooldown
  • Maximum failed attempts
  • Temporary block time
  • Reset on successful redeem

This helps protect your server and Discord webhook logs from spam.


🛠 Commands

  • /code <code> - Redeem a promo code
  • /codes reload - Reload configuration and code files
  • /codes stats - Show information about your redeemed codes
  • /codes menu - Opens the Admin Menu
  • /codes webhook test - Sends a test Discord webhook

🔐 Permissions

  • mpromocodes.use - Allows players to redeem codes
  • mpromocodes.admin - Allows admin commands
  • mpromocodes.admin.webhook - Allows testing Discord webhooks

The redeem permission can also be changed in config.yml:

settings:
  use-permission: "mpromocodes.use"

🧠 How It Works

Promo codes are defined in codes.yml.

Each code can:

  • Run multiple rewards
  • Execute console commands
  • Execute player commands
  • Send built-in plugin messages
  • Be restricted by permission
  • Have a start date
  • Have an expiry date
  • Be used once per player
  • Be used multiple times
  • Have global use limits
  • Have per-player use limits
  • Have cooldowns
  • Display a title and subtitle
  • Use advanced redeem conditions

Redeemed code data is safely stored using the selected storage type.

All actions are executed in a Folia-safe way using safe scheduling.


🚀 Server Compatibility

Bukkit

Spigot

Paper

Purpur

Folia

Java 17+


📦 File Size Notice

The plugin .jar file is larger in this version because MPromoCodes now includes built-in SQLite and MySQL database support.

To make setup easier for server owners, the required database drivers are included directly inside the plugin file. This means you do not need to download or install any extra libraries for SQLite or MySQL support.

The increased file size is expected and is caused by the bundled SQL database drivers, especially the SQLite driver, which contains native libraries for multiple operating systems.

In short:

  • The larger file size is normal
  • No extra installation is required
  • SQLite and MySQL work out of the box
  • YAML storage is still supported

💡 Why MPromoCodes?

Unlike simple command-based promo code plugins, MPromoCodes:

  • Uses a clean separated codes.yml system
  • Supports Discord webhook logging
  • Supports YAML, SQLite and MySQL storage
  • Can automatically migrate old configs and redeemed data
  • Avoids vanilla command abuse
  • Works with Folia-safe scheduling
  • Keeps configuration readable and maintainable
  • Is ideal for events, rewards, VIP promotions, giveaways and server launches

❤️ Final Words

MPromoCodes was built with performance, clarity and future compatibility in mind.

If you are looking for a clean promo code solution with modern storage, Discord logging and Folia-ready execution — this is it.


📊 Stats

https://bstats.org/plugin/bukkit/MPromoCodes

bstats

Ченджлог

1.5.1Релиз26.1, 26.1.1, 26.1.2 · 13 мая 2026 г.

MPromoCodes v1.5.1

Bug Fixes

  • Fixed Admin Menu showing Code not found for existing codes.
  • Fixed Conditions Menu that was still checking codes from config.yml
  • Fixed code key handling for mixed-case promo codes.
  • Fixed expired/upcoming lists not preserving real code names from codes.yml.
1.5Релиз26.1, 26.1.1, 26.1.2 · 12 мая 2026 г.

MPromoCodes v1.5 — Storage & Integration Update

This update brings a major internal upgrade to MPromoCodes, adding Discord webhook integration, a new separated codes file, advanced storage options, anti-spam protection and new global settings.

Added

  • Added Discord webhook integration.
  • Added Discord webhook test command:
    • /codes webhook test
  • Added webhook logs for successful code redemptions.
  • Added webhook logs for failed code redemption attempts.
  • Added configurable webhook embed colors.
  • Added configurable webhook username and avatar URL.
  • Added codes.yml as a separate file for promo codes.
  • Added automatic migration from old config.yml codes to codes.yml.
  • Added automatic backup of old config as config-old.yml.
  • Added new storage system with multiple storage backends:
    • YAML
    • SQLite
    • MySQL
  • Added automatic YAML-to-SQL migration for redeemed code data.
  • Added anti-spam protection for failed redemption attempts.
  • Added temporary blocking after too many failed attempts.
  • Added configurable failed-attempt cooldown.
  • Added configurable block time.
  • Added general plugin settings:
    • debug
    • case-insensitive-codes
    • trim-code-input
    • min-code-length
    • max-code-length
    • use-permission
  • Added configurable server name for webhook logs.
  • Added new config messages:
    • anti-spam-blocked
    • anti-spam-cooldown
    • invalid-code-length

Changed

  • Promo codes are now stored in codes.yml instead of config.yml.
  • Admin menu now reads and writes promo codes from codes.yml.
  • Redeemed code data can now be stored in YAML, SQLite or MySQL.
  • The /code command now respects configurable input rules.
  • Permission required to redeem codes is now configurable.
  • Code length validation is now configurable.
  • Code matching can now be case-sensitive or case-insensitive.
  • Code input trimming can now be enabled or disabled.
  • Webhook logs now include more detailed redemption information.
  • Internal redeem storage has been refactored for better future compatibility.

Improved

  • Improved code organization.
  • Improved update compatibility for existing users.
  • Improved config structure by separating plugin settings and promo code data.
  • Improved admin workflow for managing promo codes.
  • Improved protection against invalid code spam.
  • Improved support for larger servers and networks through SQL storage.
  • Improved debug logging for redeem attempts when debug mode is enabled.

Fixed

  • Fixed promo code data being mixed with global plugin settings.
  • Fixed hardcoded redeem permission by moving it to config.
  • Fixed hardcoded code input behavior by making it configurable.
  • Fixed admin menu storage behavior after moving codes to codes.yml.
  • Fixed future compatibility issues with redeemed code storage.

Migration Notes

  • Existing promo codes from config.yml will be automatically moved to codes.yml.
  • The old config.yml will be backed up as config-old.yml.
  • A fresh config.yml will be generated with the latest settings.
  • Existing redeemed data from redeemed.yml can be automatically migrated into SQLite or MySQL when storage.auto-migrate-yaml is enabled.
  • Server owners should review the new storage section before switching to MySQL.

Why is the file larger now?

MPromoCodes now includes built-in SQLite and MySQL support. The required database drivers are bundled directly inside the plugin .jar, so server owners do not need to install any extra libraries.

Because of these bundled SQL drivers, especially SQLite native libraries for different operating systems, the file size is larger than previous versions. This is expected and completely normal.

New Config Sections

settings:
  enabled: true
  server-name: "survival"
  debug: false
  case-insensitive-codes: true
  trim-code-input: true
  min-code-length: 2
  max-code-length: 32
  use-permission: "mpromocodes.use"

anti-spam:
  enabled: true
  failed-attempt-cooldown: "3s"
  max-failed-attempts: 5
  block-time: "1m"
  reset-on-success: true
  webhook-log-blocked-attempts: true

storage:
  type: "YAML"
  auto-migrate-yaml: true

  sqlite:
    file: "storage.db"

  mysql:
    host: "localhost"
    port: 3306
    database: "mpromocodes"
    username: "root"
    password: "password"
    use-ssl: false
    table-prefix: "mpromocodes_"
1.4Релиз26.1, 26.1.1, 26.1.2 · 30 апреля 2026 г.
  • Added support for version 26.1
  • Added 20+ conditions to use for redeeming codes
  • Added Player Usage Limit
  • Reworked Storage system
  • More optimized code
  • Full support for Spigot and Bukkit servers
1.3Релиз1.21.9, 1.21.10, 1.21.11 · 27 декабря 2025 г.
  • Added option to enable/disable code
  • Added Admin Menu for easier code configuring
  • Added option to create codes ingame menu
  • Added option to delete codes ingame menu
  • Added option to view all codes and edit them ingame menu
  • Added option to view all upcoming codes
  • Added option to view all expired codes
1.2Релиз1.21.9, 1.21.10, 1.21.11 · 21 декабря 2025 г.
  • Added start-date feature
  • Added expiry-date feature
  • Added update checker
1.1Релиз1.21.9, 1.21.10, 1.21.11 · 18 декабря 2025 г.
  • Added Global Uses for codes
  • Added bStats
1.0Релиз1.21.9, 1.21.10, 1.21.11 · 15 декабря 2025 г.
  • Redeem promo codes using /code
  • Fully configurable rewards via config
  • Supports console and player command execution
  • Title & Subtitle messages after successful redemption
  • Per-player code usage (one-time codes)
  • Permission-based code access
  • Folia compatible
  • Clean and simple configuration

Комментарии

Загружаем…