Create a COMPLETE and FULLY WORKING Minecraft Spigot/Paper plugin in Java called:
SecureAuth
Minecraft version: 1.20+
Main package: com.secureauth.plugin
Main class:
SecureAuth (extends JavaPlugin)
The plugin must be fully functional and compile without errors.
-------------------------------- CORE SYSTEM --------------------------------
This plugin implements a REGISTER + LOGIN authentication system.
All player data must be saved in config.yml.
Passwords must be stored in plain text exactly like:
players:
PlayerName: password: "12345"
-------------------------------- JOIN SYSTEM --------------------------------
When player joins:
IF player NOT registered:
Show TITLE:
Title: §a/register Subtitle: §7Use /register <password>
Teleport player to server spawn.
Apply BLINDNESS effect.
Player must register.
--------------------------------
IF player IS registered:
Show TITLE:
Title: §e/login Subtitle: §7Use /login <password>
Teleport player to spawn.
Apply BLINDNESS effect.
--------------------------------
Before teleporting player to spawn:
Save their previous location in memory using:
HashMap<UUID, Location> previousLocation
-------------------------------- REGISTER COMMAND --------------------------------
Command:
/register <password>
Requirements:
• Only works if player not registered • Save password to config.yml • Mark player as logged in • Remove blindness • Teleport player back to saved location
Show TITLE:
Title: §aSuccessfully Registered Subtitle: §7Welcome
-------------------------------- LOGIN COMMAND --------------------------------
Command:
/login <password>
Requirements:
• Check password from config.yml
If password correct:
• Mark player logged in • Remove blindness • Teleport player back to saved location
Show TITLE:
Title: §aSuccessfully Logged In Subtitle: §7Welcome back
If password wrong:
Send message: §cInvalid password
Increase login attempt counter.
After 3 wrong attempts:
Kick player.
Kick message: §cToo many wrong passwords.
-------------------------------- PASSWORD CHANGE --------------------------------
Command:
/changepass <oldpass> <newpass>
Requirements:
• Verify old password • Update config.yml • Save config
Send message:
§aPassword changed successfully.
-------------------------------- ADMIN PASSWORD CHANGE --------------------------------
Command:
/adminpasschange <player> <newpass>
Permission:
secureauth.admin
Allows admin to change any player's password.
-------------------------------- PLAYER LOCK SYSTEM --------------------------------
While player NOT logged in:
They must be completely frozen.
Use HashMap:
HashMap<UUID, Boolean> loggedIn
Block ALL gameplay actions.
-------------------------------- BLOCK THESE EVENTS --------------------------------
If player not logged in cancel:
PlayerMoveEvent BlockBreakEvent BlockPlaceEvent EntityDamageByEntityEvent PlayerDropItemEvent PlayerInteractEvent PlayerInteractEntityEvent PlayerSwapHandItemsEvent PlayerItemConsumeEvent ProjectileLaunchEvent PlayerTeleportEvent InventoryClickEvent
-------------------------------- ITEM USE BLOCK --------------------------------
Players cannot use:
Ender Pearl Wind Charge Bow Crossbow Trident Snowball Egg Any throwable item
Cancel PlayerInteractEvent if holding these.
-------------------------------- COMMAND BLOCK --------------------------------
Players who are NOT logged in can ONLY use:
/login /register
Block all other commands using PlayerCommandPreprocessEvent.
-------------------------------- BLINDNESS EFFECT --------------------------------
Apply blindness effect while player not logged in:
Duration: infinite
PotionEffectType.BLINDNESS
-------------------------------- DATA STRUCTURES --------------------------------
Use:
HashMap<UUID, Boolean> loggedIn HashMap<UUID, Location> previousLocation HashMap<UUID, Integer> loginAttempts
-------------------------------- PLUGIN.YML --------------------------------
name: SecureAuth version: 1.0 main: com.secureauth.plugin.SecureAuth api-version: 1.20
commands: register: description: register password login: description: login password changepass: description: change password adminpasschange: description: admin change password
permissions: secureauth.admin: default: op
-------------------------------- IMPORTANT --------------------------------
Plugin MUST:
✔ Work on multiplayer servers ✔ Compile with Spigot API ✔ Save config automatically ✔ Cancel events properly ✔ Restore player location after login ✔ Prevent movement before login ✔ Block item use ✔ Block ender pearl ✔ Block wind charge ✔ Show titles correctly ✔ Handle wrong passwords ✔ Kick after 3 wrong attempts
-------------------------------- OUTPUT REQUIRED --------------------------------
Generate FULL plugin source code including:
SecureAuth.java AuthListener.java RegisterCommand.java LoginCommand.java ChangePassCommand.java AdminPassCommand.java plugin.yml
Ensure code compiles without errors.