Create a Minecraft plugin for Paper/Spigot (1.20+ compatible) named "DNGR-BANS".
IMPORTANT:
- Only include BAN and TEMPBAN system
- Do NOT include warn, kick, mute systems
- Must support fully customizable messages
- Must replicate LiteBans-style UI and messages
- DO NOT change config structure at all
---
MAIN FEATURES
- Ban System:
- TempBan System:
- /tempban <player> <time> <reason>
---
CRITICAL TIME SYSTEM (VERY IMPORTANT)
The tempban time system MUST be fully flexible.
REQUIREMENTS:
- Player can set ANY custom time
- Do NOT restrict to only single formats
SUPPORTED FORMAT:
ALSO SUPPORT COMBINED TIME:
- 1d12h
- 2h30m
- 1d2h30m
- 7d5h10m20s
RULES:
- Must be case insensitive (allow 24H, 1D etc.)
- Must support multiple time units in one string
- Convert everything into milliseconds
- Lowercase input before parsing
- NO "Invalid time format" error for valid combinations
- no valid time found - input completely invalid
---
UNBAN SYSTEM
- /unban <player>
- Must remove BOTH tempban and permanent ban
---
CONFIG SYSTEM (DO NOT CHANGE ANYTHING)
USE EXACTLY THIS CONFIG:
messages: prefix: "&8[&c!&8]" no-permission: "&cYou don't have permission to use this command."
broadcast: line1: "&8[&c!&8] &6{player} &7has been {type}" line2: "&cHOVER FOR INFO" hover: |- &fPlayer: &c{player} &fPunished By: &c{punisher} &fReason: &c{reason} &fDuration: &c{duration}
ban-screen: permanent: |- &e&l⚡ &4&lDANGER SMP &e&l⚡ &f━━━━━━━━━━━━
&f🔥 &c&lYOURE BANNED FROM THE SERVER &f🔥
&c👤 &fUsername &f» &c{player} &c⏱ &fPunished On &f» &c{date} &c⚒ &fPunished By &f» &c{punisher} &c✎ &fReason &f» &c{reason}
&f🔥 &cTHIS PUNISHMENT IS {permanent} &f🔥 &c✉ &fAppeal &f» &chttps://discord.gg/f8sbqAqTmn
temporary: |- &e&l⚡ &4&lDANGER SMP &e&l⚡ &f━━━━━━━━━━━━
&f🔥 &c&lYOURE BANNED FROM THE SERVER &f🔥
&c👤 &fUsername &f» &c{player} &c⏱ &fPunished On &f» &c{date} &c⚒ &fPunished By &f» &c{punisher} &c✎ &fReason &f» &c{reason}
&f━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
&c📘 &fExpiry Date &f» &c{expiry} &c⏳ &fExpires In &f» &c{time_left}
&f━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
&f🔥 &cTHIS PUNISHMENT IS {permanent} &f🔥 &c✉ &fAppeal &f» &chttps://discord.gg/f8sbqAqTmn
---
RELOAD SYSTEM
- /dngrban reload
- Must reload config properly
---
DATA SYSTEM
- bans.yml storage
- save all punishment data
---
CODE REQUIREMENTS
- Clean Java code
- Use regex-based time parser
- No hardcoded limits on time
- No memory leaks
- Optimized performance
---
ADDITIONAL FEATURE (DO NOT MODIFY EXISTING SYSTEM)
Add an automatic illegal item and enchantment detection system.
IMPORTANT:
- This must NOT modify or break any existing ban/tempban system
- This must internally use the same ban system (/ban logic) when triggered
---
AUTO BAN SYSTEM
- Enchantment Rule (All Items Except Mace):
- If any item (except mace) has enchantment level greater than 10 → BAN
- Enchantment level ≤ 10 → allowed
- Mace Rule:
- Mace must ONLY allow vanilla/default enchantments
- If mace has:
- Any invalid enchant → BAN - Any enchant level above vanilla max → BAN
- Illegal Items (Instant Ban):
- Bedrock
- Barrier
- Command Block (all types)
- Structure Block
- Debug Stick
→ If found → instantly BAN using internal ban system
IMPORTANT:
- When player is auto-banned by this system:
Reason MUST always be: "ILLIGAL STUFF"
---
CHECK SYSTEM
- PlayerJoinEvent - InventoryClickEvent - EntityPickupItemEvent - Every 5 seconds (repeating task)
- Inventory - Armor slots - Ender chest
---
WHITELIST SYSTEM
Add whitelist for auto-ban system.
CONFIG ADDITION:
whitelist: enabled: true players:
BEHAVIOR:
- If player is in whitelist:
- Skip ALL illegal checks - Never auto-ban
1. Permission "dngrban.bypass" 2. Whitelist 3. Then checks
---
BYPASS PERMISSION
- Permission: dngrban.bypass
---
LOGGING SYSTEM
/plugins/DNGR-BANS/logs.txt
- Command bans - Auto bans
Format: [YYYY-MM-DD HH:MM:SS] Player: {player} | Type: {BAN/TEMPBAN/AUTO-BAN} | Reason: {reason}
Examples: [2026-03-23 16:45:12] Player: Steve | Type: AUTO-BAN | Reason: ILLIGAL STUFF
- Auto-create file if not exists - Append logs (do not overwrite) - Log in console as well
---
INTEGRATION RULE
- Auto-ban system MUST call existing ban manager
- Do NOT duplicate ban logic
- Use same config/messages
---
OUTPUT
Provide full source code:
- Main class
- Commands
- Ban manager
- Listener
- Time parser class
- Logging utility
- plugin.yml
- config.yml
- bans.yml example
- Ready to compile without errors