๐
1 file
1,546 chars
๐
pasted-code-1777923364658.txt
txt
71 lines
โถ
pasted-code-1777923364658.txt
txt
71 lines
Create a Minecraft plugin for Paper API (versions 1.21โ1.21.11) using Java.
๐ Plugin Concept:
The plugin tracks specific player commands and sends detailed logs to a Discord channel using a webhook URL.
โ๏ธ Features:
Monitor only these commands:
gamemode, gm, gS, give, xp, level, ban, ipban, op, deop,
mute, unmute, invsee, enchant, endersee, kill, tp,
tpa, tpahere, kick
When any player executes one of these commands:
Capture:
Player name
UUID
Full command used (including arguments)
Timestamp (formatted, e.g. yyyy-MM-dd HH:mm:ss)
Send this data to a Discord webhook as a formatted message (JSON POST request)
๐ Config Requirements:
Create a config.yml with:
webhook-url: "YOUR_DISCORD_WEBHOOK_URL"
tracked-commands:
- gamemode
- gm
- gS
- give
- xp
- level
- ban
- ipban
- op
- deop
- mute
- unmute
- invsee
- enchant
- endersee
- kill
- tp
- tpa
- tpahere
- kick
Server owners must be able to:
Add/remove commands
Modify the list without recompiling
๐ง Technical Requirements:
Use Paper API event listeners (PlayerCommandPreprocessEvent)
Async webhook sending (to avoid blocking server thread)
Clean plugin structure:
Main class
Config manager
Webhook utility class
Handle edge cases:
Ignore commands not in config
Prevent console commands from being logged (only players)
Use proper plugin.yml setup
๐ฌ Discord Message Format:
Example:
๐ Command Used
๐ค Player: Notch
๐ UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
โจ๏ธ Command: /gamemode creative {Player_name}
โฐ Time: 2026-05-05 14:32:10
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code