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

DiscordInvitesRewards

A lightweight plugin that rewards players for inviting other players to your discord server.

Загрузки
64
Подписчики
0
Обновлён
14 июня 2026 г.
Лицензия
All-Rights-Reserved

Опубликован 2 апреля 2026 г.

Исходный код

🎁 InvitesRewards

Turn Discord server growth into Minecraft rewards.

InvitesRewards tracks Discord invites, rewards players in-game, and eliminates the biggest problem with invite-reward systems: account linking issues.

Instead of requiring players to link their Minecraft account before receiving rewards, InvitesRewards automatically sends a unique claim code through Discord DMs. Players can redeem rewards whenever they're ready, ensuring no reward is ever lost.

Perfect for SMPs, communities, and large networks looking to grow their Discord server while rewarding loyal members.


🚀 Why InvitesRewards?

Most invite tracking plugins suffer from one of three problems:

  • Players lose rewards because they forgot to link their account.
  • Invite systems are easy to abuse with alts and bots.
  • Server owners have limited control over rewards and progression.

InvitesRewards solves all three.

✅ No Pre-Linking Required

When a member successfully invites someone to your Discord server, they receive a private DM containing a unique reward code.

Simply run:

/ir claim <code>

and claim the reward in-game.

No websites. No registration. No complicated setup.

🔗 DiscordSRV Integration

Already using DiscordSRV?

InvitesRewards can automatically detect linked Minecraft accounts and synchronize:

  • Invite counts
  • Leaderboards
  • Reward eligibility
  • Player statistics

Players who are already linked enjoy a completely seamless experience.

🏆 Milestones & Rankings

Encourage community growth with configurable invite milestones.

Examples:

  • 5 Invites → VIP
  • 10 Invites → MVP
  • 25 Invites → Elite
  • 50 Invites → Legend

Execute any command when milestones are reached.

Compatible with LuckPerms and other permission systems.

📊 Invite Leaderboards

Reward your most active community members.

Track invite counts directly in Minecraft and showcase your top promoters using built-in leaderboard support.

🛡️ Anti-Abuse Protection

Stop invite farming before it starts.

Features include:

  • Minimum Discord account age requirements
  • Bot account detection
  • Invite validation through Discord's API
  • Reward protection against fake accounts

Keep rewards fair and your economy protected.

💎 Dynamic Reward Groups

Give different rewards based on permissions.

groups: 
  default: 
    permission: "invitesreward.group.default" 
    commands: ["give %player_name% diamond 8"] 
  vip: 
    permission: "invitesreward.group.vip" 
    commands: ["give %player_name% epic_crate_key 1"]
  multiplecommands:
    permission: "invitesreward.group.multiplecommands"
    commands:
    - "give %player_name% diamond 8"
    - "eco give %player_name% 1000"
    - "broadcast %player_name% just claimed a reward for inviting their friend!"

Perfect for VIPs, boosters, donors, staff, and custom ranks.

🗄️ Flexible Storage

Choose the storage option that fits your server:

  • SQLite for simple setup
  • MySQL for networks and cross-server synchronization

🎮 Commands

Base Command: /invitesreward Alias: /ir

Command Description Permission
/ir claim <code> Redeem a reward code None
/ir generate Generate a reward code manually invitesreward.admin
/ir reload Reload configuration files invitesreward.admin
/ir help Display help information None

⚙️ Setup

1. Create a Discord Bot

Create a bot through the Discord Developer Portal.

2. Enable Required Intents

Enable:

  • Server Members Intent
  • Message Content Intent

3. Invite Your Bot

Invite the bot with permissions to:

  • Manage Server
  • View Channels
  • Send Messages
  • Direct Message Members

4. Configure InvitesRewards

Paste your bot token into config.yml.

Configure rewards, milestones, and anti-abuse settings.

5. Start Growing

Players invite friends. Rewards are automatically delivered. Your community grows.


💬 Support

Need help or have suggestions?

Join the support server:

https://discord.notnawfas.qzz.io


Ченджлог

2.0.0Релиз1.21.9, 1.21.10, 1.21.11 · 14 июня 2026 г.

Huge changes is Security. Added DiscordSRV Integration and Fixed some major bugs.

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

Changelogs

v1.1.0 - Security & Bug Fix Release

Critical Fixes

  • Rejoin Exploit Prevention: Added tracking of Discord user IDs that have already been counted as valid invites. Previously, a single user could join, leave, and rejoin repeatedly via the same invite link to farm reward codes for the inviter. Now, onGuildMemberJoin checks a counted-users list persisted in data.yml before issuing a reward. If a user has already been counted, the join event is silently skipped.

High Severity Fixes

  • Race Condition in Code Generation/Claiming: All read-modify-write operations on active-codes and counted-users in RewardCodeManager are now wrapped in a synchronized (dataLock) block. Previously, concurrent code generation or claims could corrupt the code list, leading to lost or duplicate codes.

  • Multiple Invite Detection: onGuildMemberJoin now collects all invites with an increased use count (instead of stopping at the first one). Previously, if two users joined via different invite links between cache updates, only the first inviter was credited and the second was silently lost.

Medium Severity Fixes

  • Async Save Data Corruption: Replaced saveDataAsync() with saveDataSync() as the primary save method in RewardCodeManager. The old async save could result in corrupted or partially-written data.yml because Bukkit's FileConfiguration.save() is not thread-safe and the in-memory data could be modified before the async write completed. saveDataAsync() is retained but marked @Deprecated.

  • Console Command Injection via Player Name: Added a VALID_PLAYER_NAME regex pattern (^[a-zA-Z0-9_]{1,16}$) that validates the player's name before substituting it into reward commands. On cracked/offline-mode servers, malicious player names containing spaces or special characters could manipulate console commands. Invalid usernames now receive an error message instead.

  • Bot Token Validation on Reload: /invitesreward reload now validates the bot token before restarting the Discord bot. If the token is null or empty, the bot is stopped and the admin is warned, rather than attempting to start JDA with an invalid token.

Low Severity Fixes

  • JDA Shutdown Without Awaiting: DiscordBot.stop() now calls jda.awaitShutdown(5, TimeUnit.SECONDS) after jda.shutdown(), with a fallback to jda.shutdownNow() if the graceful shutdown times out. This prevents ghost connections during server shutdown.

  • DM Failure Silently Ignored: Added proper error handling to sendDM() in DiscordBot. Previously, if a user had DMs disabled or the private channel couldn't be opened, the failure was silently ignored. Now, failures are logged as warnings.

  • Missing tutorial.md Resource: Removed the plugin.saveResource("tutorial.md", false) call from ConfigManager.setup(). The tutorial.md file was referenced but never existed in src/main/resources/, causing an IllegalArgumentException on first startup.

New Features

  • Duplicate Code Prevention: generateCode() now checks that the generated code doesn't already exist in active-codes before returning it. If a collision occurs (extremely unlikely with 6-char alphanumeric), it regenerates.

  • Reward Command Error Handling: handleClaim() now wraps dispatchCommand() in a try-catch so a failing reward command doesn't prevent other commands in the same group from executing, and the failure is logged.

Source code can be found in GitHub

© Copyright 2026 NotNawfas. All rights reserved. Redistribution is strictly prohibited.

1.1.0Релиз1.21.9, 1.21.10, 1.21.11 · 29 мая 2026 г.

Changelogs

v1.1.0 - Security & Bug Fix Release

Critical Fixes

  • Rejoin Exploit Prevention: Added tracking of Discord user IDs that have already been counted as valid invites. Previously, a single user could join, leave, and rejoin repeatedly via the same invite link to farm reward codes for the inviter. Now, onGuildMemberJoin checks a counted-users list persisted in data.yml before issuing a reward. If a user has already been counted, the join event is silently skipped.

High Severity Fixes

  • Race Condition in Code Generation/Claiming: All read-modify-write operations on active-codes and counted-users in RewardCodeManager are now wrapped in a synchronized (dataLock) block. Previously, concurrent code generation or claims could corrupt the code list, leading to lost or duplicate codes.

  • Multiple Invite Detection: onGuildMemberJoin now collects all invites with an increased use count (instead of stopping at the first one). Previously, if two users joined via different invite links between cache updates, only the first inviter was credited and the second was silently lost.

Medium Severity Fixes

  • Async Save Data Corruption: Replaced saveDataAsync() with saveDataSync() as the primary save method in RewardCodeManager. The old async save could result in corrupted or partially-written data.yml because Bukkit's FileConfiguration.save() is not thread-safe and the in-memory data could be modified before the async write completed. saveDataAsync() is retained but marked @Deprecated.

  • Console Command Injection via Player Name: Added a VALID_PLAYER_NAME regex pattern (^[a-zA-Z0-9_]{1,16}$) that validates the player's name before substituting it into reward commands. On cracked/offline-mode servers, malicious player names containing spaces or special characters could manipulate console commands. Invalid usernames now receive an error message instead.

  • Bot Token Validation on Reload: /invitesreward reload now validates the bot token before restarting the Discord bot. If the token is null or empty, the bot is stopped and the admin is warned, rather than attempting to start JDA with an invalid token.

Low Severity Fixes

  • JDA Shutdown Without Awaiting: DiscordBot.stop() now calls jda.awaitShutdown(5, TimeUnit.SECONDS) after jda.shutdown(), with a fallback to jda.shutdownNow() if the graceful shutdown times out. This prevents ghost connections during server shutdown.

  • DM Failure Silently Ignored: Added proper error handling to sendDM() in DiscordBot. Previously, if a user had DMs disabled or the private channel couldn't be opened, the failure was silently ignored. Now, failures are logged as warnings.

  • Missing tutorial.md Resource: Removed the plugin.saveResource("tutorial.md", false) call from ConfigManager.setup(). The tutorial.md file was referenced but never existed in src/main/resources/, causing an IllegalArgumentException on first startup.

New Features

  • Duplicate Code Prevention: generateCode() now checks that the generated code doesn't already exist in active-codes before returning it. If a collision occurs (extremely unlikely with 6-char alphanumeric), it regenerates.

  • Reward Command Error Handling: handleClaim() now wraps dispatchCommand() in a try-catch so a failing reward command doesn't prevent other commands in the same group from executing, and the failure is logged.

Source code can be found in GitHub

© Copyright 2026 NotNawfas. All rights reserved. Redistribution is strictly prohibited.

1.0.0Релиз1.21.9, 1.21.10, 1.21.11 · 22 апреля 2026 г.

First ever release. report any bugs in https://discord.gg/JnTmmb9rDH

Комментарии

Загружаем…