Create a Minecraft plugin with the following requirements:
Plugin Name: SetSpawn Java Version: 21 Minecraft Version: 1.21.11 and below (Spigot/Paper)
Core Features:
- Commands:
- /setspawn → Sets the spawn location to the player's current position
• Permission: Only admins (use permission: setspawn.admin)
- /spawn → Teleports the player to the saved spawn location
- Combat Restriction:
- If a player is in combat, they cannot use /spawn
- Combat lasts for 10 seconds after being hit
- If the player tries to use /spawn during combat, cancel teleport and show a message
- Teleport Cooldown:
- When a player uses /spawn, there is a 5-second delay before teleporting
- During this time, show a mini-screen countdown message:
Example: "Teleporting to spawn in 5..." "Teleporting to spawn in 4..."
- If the player moves or takes damage, cancel the teleport
- Messages:
- All messages must use a prefix: [PickleSpawn]
- The prefix must be configurable in config.yml
- All messages (combat blocked, countdown, success, cancel, etc.) must be customizable in config.yml
- Config:
- config.yml should include:
• Prefix • All messages • Teleport delay time (default: 5 seconds) • Combat duration (default: 10 seconds)
- Data Storage:
- Save spawn location in a file (config.yml or separate file like spawn.yml)
- Ensure spawn persists after server restart
- Code Requirements:
- Clean, optimized, and well-structured code
- Use modern Java (Java 21 features if needed)
- No unnecessary features, no addons, keep it lightweight
Important:
- Do NOT include extra systems like INVENTORY GUI, economy, or permissions plugin integration
- Only implement exactly what is described above
Output:
- Full plugin source code
- plugin.yml
- config.yml
- Main class and all required classes
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code