Create a Minecraft Spigot/Paper plugin in Java called "SecureAuth".
Main package: com.secureauth.plugin
Main class:
SecureAuth
Minecraft version: 1.20+
The plugin must implement a full REGISTER and LOGIN system.
-----------------------------------
PLUGIN FEATURES
-----------------------------------
- REGISTER SYSTEM
When a player joins the server for the FIRST TIME:
Show a TITLE message:
Title: §a/register Subtitle: §7Use /register <password>
Player must run:
/register <password>
After successful register:
Show TITLE:
Title: §aSuccessfully Registered Subtitle: §7You can now login when you rejoin
Send chat message: §aRegistration complete!
Save password in config.yml in PLAIN TEXT.
Example config.yml:
players:
Notch: password: "12345"
-----------------------------------
- LOGIN SYSTEM
When a registered player joins again:
Teleport player to spawn location.
Show TITLE:
Title: §e/login Subtitle: §7Use /login <password>
Player must type:
/login <password>
If password correct:
Show TITLE:
Title: §aSuccessfully Logged In Subtitle: §7Welcome back
Teleport player back to the location where they were before join.
Remove blindness effect.
Allow all actions again.
If password incorrect:
Send message: §cInvalid password.
Kick player from server after 3 wrong attempts.
Kick message: §cWrong password!
-----------------------------------
- LOGIN PROTECTION
While player is NOT logged in:
Apply BLINDNESS effect.
Cancel these actions:
PlayerMoveEvent → cancel movement
EntityDamageByEntityEvent → cannot hit players
BlockBreakEvent → cancel
BlockPlaceEvent → cancel
PlayerDropItemEvent → cancel
PlayerInteractEvent → cancel
PlayerInteractEntityEvent → cancel
ProjectileLaunchEvent → cancel
PlayerTeleportEvent → cancel
PlayerSwapHandItemsEvent → cancel
PlayerItemConsumeEvent → cancel
PlayerCommandPreprocessEvent → block all commands except:
/login /register
Also block using:
- Ender Pearl
- Wind Charge / Wind Burst
- Bow
- Crossbow
- Trident
- Any throwable item
- Any item use
-----------------------------------
- SPAWN TELEPORT SYSTEM
When player joins:
Save their previous location in memory using HashMap.
Teleport them to server spawn location.
After successful login:
Teleport them back to the saved location.
-----------------------------------
- PASSWORD CHANGE COMMAND
Command:
/changepass <oldpassword> <newpassword>
If old password matches:
Change password in config.yml.
Send message:
§aPassword changed successfully.
-----------------------------------
- ADMIN PASSWORD CHANGE
Command:
/adminpasschange <player> <newpassword>
Permission required:
secureauth.admin
Allows admin to change any player's password.
Send message:
§aPassword changed for player.
-----------------------------------
- CONFIG FILE
config.yml structure:
players: playername: password: "password"
-----------------------------------
- DATA STRUCTURES
Use:
HashMap<UUID, Boolean> loggedInPlayers HashMap<UUID, Location> playerLastLocation HashMap<UUID, Integer> loginAttempts
-----------------------------------
- TITLE SYSTEM
Register title:
GREEN
Login title:
YELLOW
Success title:
GREEN
-----------------------------------
- PLUGIN.YML
name: SecureAuth main: com.secureauth.plugin.SecureAuth version: 1.0 api-version: 1.20
commands: register: description: register password login: description: login password changepass: description: change password adminpasschange: description: admin password change
permissions: secureauth.admin: default: op
-----------------------------------
- IMPORTANT REQUIREMENTS
The plugin must:
✔ Fully compile ✔ Work on multiplayer servers ✔ Auto create config.yml ✔ Save passwords in config ✔ Use Bukkit API correctly ✔ Cancel ALL gameplay actions before login ✔ Restore player location after login ✔ Use listener classes ✔ Be cleanly structured
-----------------------------------
Generate the FULL Java plugin code including:
- Main class
- Command classes
- Event listener class
- plugin.yml