Tags
Creators
Details
1.5
Compatibility
Changes
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.ymlas a separate file for promo codes. - Added automatic migration from old
config.ymlcodes tocodes.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:
debugcase-insensitive-codestrim-code-inputmin-code-lengthmax-code-lengthuse-permission
- Added configurable server name for webhook logs.
- Added new config messages:
anti-spam-blockedanti-spam-cooldowninvalid-code-length
Changed
- Promo codes are now stored in
codes.ymlinstead ofconfig.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
/codecommand 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.ymlwill be automatically moved tocodes.yml. - The old
config.ymlwill be backed up asconfig-old.yml. - A fresh
config.ymlwill be generated with the latest settings. - Existing redeemed data from
redeemed.ymlcan be automatically migrated into SQLite or MySQL whenstorage.auto-migrate-yamlis enabled. - Server owners should review the new
storagesection 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_"
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:5XgdhBMc:aSu7D7yD"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:5XgdhBMc:aSu7D7yD"
}

