Added a multi world support. You can now set multiple Nightmare world, when player got nightmare they will get teleported in one of those worlds. Player will now only escape nightmare if they returned to their original world instead of just exiting the nightmare world.
Warning: Only use this on a stable version of Spigot You will get Error if you use this on 1.16.5
Disable Commands: If you want to disable some commands during nightmare, like for example any teleport command, just put the command here, by default and also as an example, I only added the /tp, /spawn, /warp, /home. If the player is currently in Nightmare, they should not be able to use those commands.
Fix Bugs: There's a dupping bug where, when the server has AngelChest plugin and is enabled, then the "Keep Inventory" is set to true, player's inventory will duplicate upon death. As a temporary fix, if you have the AngelChest plugin, keep inventory won't work even if it is set to true.
Note: I change the version format from 1.3 to 1.3.1, the other .1 will be for small fix/updates.
Keep Inventory: When the players teleports, their items will be stored, then the items in their inventory will be replace to just, by default a wooden pickaxe and bread. After they escape, the wooden pickaxe and bread will be replace by their original item.
Add Timer: You can choose to either add a timer to their nightmare and if this runs out, the player will be forcefully awaken and will experience Nausea and Hunger.
- I also added a scoreboard to display the remaining time before you get forcefully awaken.
Bug Fix: There was a bug before that when you set the "Force Death" and "Keep Inventory" to true, then you use a portal, even if you still have nightmare, your item will be return to you.
Current Bug: Right now there's a bug where, if you sleep and got a nightmare and at the same time also got damage, i.e, while sleeping a zombie hit you and you got a nightmare, then you will glitch, players won't be able to see you and you won't be able to send any messages, sometimes you will also get a "Error executing task on Server" error. Quick fix is the player just need to logout and log back in.
Not sure if I can fix this one, since I only started learning Java just a few days ago
WARNING: Have not tried this in a medium to large server or a multi world server,
be careful, if the
server stops or crash and some player are still in nightmare, all of their items will be gone.
Added an option where you can configure it if you want the player to teleport randomly or if you want them to teleport in a specific location. Don't forget to change the world name if you want them to teleport in a specific location in a world