nawajahmad3535-afk

GodWhitelist

Plugin Information

  • Plugin Name: GodWhitelist
  • Minecraft Version: Paper/Spigot 1.21+
  • Developer Credit: SkyKing01

---

Plugin Purpose

GodWhitelist is a Discord-integrated whitelist plugin that automatically manages server access through a Discord channel. Players can whitelist themselves by sending their Minecraft username in a configured Discord channel.

No INVENTORY GUI. Lightweight and simple.

---

Discord Integration

Auto Whitelist System

The plugin connects to a Discord bot and monitors a configured channel.

When a player sends a message in the configured channel:

Example:

Steve

The plugin will:

  1. Check if the username is valid.
  2. Automatically add the player to the Minecraft whitelist.
  3. Save the whitelist date.
  4. Send a confirmation message in Discord.
  5. Log the action in console.

Example Discord Response:

✅ Steve has been added to the whitelist.

---

Auto Unwhitelist System

The plugin tracks the last join date of every whitelisted player.

If a player does not join the server for 10 days:

  • Automatically remove them from the whitelist.
  • Send a Discord notification.
  • Log the action in console.

Example:

❌ Steve was removed from the whitelist due to 10 days of inactivity.

---

Commands

Admin Commands

/gw reload

Reload all configuration files.

Permission:

godwhitelist.reload

/gw on

Enable whitelist protection.

Permission:

godwhitelist.admin

/gw off

Disable whitelist protection.

Permission:

godwhitelist.admin

/gw whitelist <player>

Manually whitelist a player.

Permission:

godwhitelist.admin

/gw unwhitelist <player>

Manually remove a player from the whitelist.

Permission:

godwhitelist.admin

---

Config.yml

whitelist-enabled: true

auto-unwhitelist-days: 10

discord: enabled: true

bot-token: ""

whitelist-channel-id: ""

messages: whitelist-success: "&aYou have been whitelisted." auto-remove: "&cRemoved due to inactivity."

---

Data Storage

Store:

  • UUID
  • Username
  • Whitelist Date
  • Last Join Date

Use YAML by default.

---

Startup

When the server starts:

  • Connect to Discord bot.
  • Load all whitelist data.
  • Start inactivity checker.
  • Log successful connection.

Console:

[GodWhitelist] Connected to Discord. [GodWhitelist] Inactivity checker started.

---

Performance Requirements

  • Fully asynchronous Discord API.
  • No lag on main thread.
  • Automatic data saving.
  • Support hundreds of players.

---

Goal

Create a lightweight whitelist plugin where players whitelist themselves through Discord and inactive players are automatically removed after 10 days without joining the server.

Kodari AI
KodariJun 6 at 2:50 pm 1

The generation was stopped before any content could be produced.

Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code