Home›Java›Mods›mCodes
mCodes

mCodes

Transactional promo and referral codes with durable rewards for Paper, Purpur, and Folia.

Paper Purpur

GitHub Modrinth Discord

bStats Release Java 25 Minecraft 26.2

mCodes provides ready-to-use promo codes and two-sided referral rewards. Limits, eligibility and the reward journal are committed in one H2 transaction so concurrent redemptions cannot overspend a campaign.

What it does

Quick start

  1. Put mCodes-1.1.0.jar in the server's plugins directory and restart.
  2. Keep the generated security.identity-secret private and unchanged.
  3. Adjust the reward commands in plugins/mCodes/config.yml.
  4. Create a campaign with /code create WELCOME 100 1 168.
  5. Players redeem it with /code redeem WELCOME.

The bundled configuration works immediately: WELCOME in the example is limited to 100 total uses, one use per player, and expires after 168 hours.

Commands

Players receive mcodes.use by default. Administrative commands require mcodes.admin, which defaults to server operators.

Language and configuration

English is selected by default. Set language: ru_RU and run /code reload to switch the interface to Russian.

anti-abuse.identity-enabled controls keyed network-identity checks. referral-per-identity defaults to one, while promo network limits are disabled until promo-per-identity is increased. Minimum playtime and all console reward commands are documented in the generated configuration. Supported placeholders are {player}, {referrer} and {redeemer}.

Changing security.identity-secret invalidates comparisons with previously stored identity hashes. Back it up with the database and never publish it.

Reward recovery

A successful redemption first creates a PENDING journal entry. Delivery atomically claims it as CLAIMED before any console command runs and then marks it DELIVERED. Pending entries can be retried safely. A claimed entry means the process may have stopped while commands were running, so mCodes leaves it for staff review instead of risking duplicate currency or items.

Reward commands should still be designed to be idempotent where possible because Minecraft commands cannot participate in a database transaction.

Requirements

No economy, permissions or external database plugin is required. Reward commands may call any plugin already installed on the server.

Storage and privacy

Campaigns, redemptions and the recovery journal are stored in plugins/mCodes/codes.mv.db. Schema upgrades run automatically. mCodes uses anonymous bStats metrics when metrics.enabled is true; disable it in the configuration or through the global bStats setting. Codes, UUIDs, player names, addresses, identity hashes and reward contents are never sent to bStats.

Build

./gradlew clean build

The release JAR is written to build/libs/mCodes-1.1.0.jar.

Licensed under the MIT License.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more