Protect players while sleeping

Supported Games
GameServerKingsGameServerKings

Info

The plugin provides the following features to protect sleeping players. Everything is customizable.

  1. bots can ignore sleeping players

  2. animals can ignore sleeping players

3,4) bots and animals can lose sight of a player as soon as he goes to sleep.

  1. cancel damage to the player by other players while he sleeps.

  2. you can customize the ability to loot sleeping players

Configuration

This is default settings:

{
  "trigger animal on sleeping player": false,
  "trigger npc player on sleeping player": false,
  "remove sleeping players from animal targeting": true,
  "remove sleeping players from npc players targeting": true,
  "cancel damage to sleeping player": true,
  "cancel looting of sleeping player": true
}

"trigger animal on sleeping player" - if the value is true, then animals will be able to find sleeping players and attack them.

"trigger npc player on sleeping player" - the same as previos but instead of animals - bots(like scientists)

"remove sleeping players from animal targeting" - if the value is true, then immediately after the player goes to sleep, an animal such as a bear will lose sight of him. This setting makes little sense with “trigger animal on sleeping player”: true.

"remove sleeping players from npc players targeting" - same as "remove sleeping players from animal targeting" but with npcs such as Scientists. This setting makes little sense with “trigger npc player on sleeping player”: true.

"cancel damage to sleeping player" - if true - cancel damage from player for sleepers. Does not protect from fire or starving.

"cancel looting of sleeping player" - if true - makes looting player not possible when he is sleeping.

Permissions

The permission is sleepprotection.use and 'sleepprotection.ignore'

In case if player with .ignore will attack sleeper he will damage sleeper. If Player have .ignore permission he can loot sleepers in any case.

Support

If you have any idea how to improve plugin, or you find some problems or errors, please contact me on uMod or discord: as_notchu

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.