Duel Requests: Players use /duel <player> to challenge another player. The challenged player receives a notification and can accept with /duelaccept or deny with /dueldeny.
Starting a Duel: When a duel is accepted, both players' current inventories, armor, health, and hunger levels are saved. Their inventories and armor are cleared, and their health and hunger are reset to ensure a fair duel. Players are teleported to their designated spawn points in the duel region.
Ending a Duel: After the duel, players' inventories, armor, health, and hunger are restored to their pre-duel states.
Setting Spawn Points: Administrators can set custom spawn points for player1 and player2 in each duel region using /setduelspawn <region_id> <player1|player2>. These locations are stored in a JSON file for persistence across server restarts.
Data Persistence
Duel States: Player states (inventories, armor, health, and hunger) are saved to and loaded from a JSON file (duels.json).
Duel Locations: Custom spawn points for each region are saved to and loaded from a JSON file (duel_locations.json).