EssentialsX / Essentials

The modern Essentials suite for Spigot and Paper.
https://essentialsx.net
GNU General Public License v3.0
1.94k stars 979 forks source link

Add config option and/or permission for ignoring monsters nearby to sleep #3734

Open Andre601 opened 3 years ago

Andre601 commented 3 years ago

Feature request

Feature description

It would be nice, if there was a config option and/or permission to ignore the "You may not sleep now. Thee are monsters nearby." issue.

How the feature is useful

It can become annoying if you want to sleep to make it day, but one can't because there are monsters somewhere that can't be found.

Chew commented 3 years ago

This doesn't seem like something Essentials can override (I believe).

Andre601 commented 3 years ago

This doesn't seem like something Essentials can override (I believe).

From a small chat on the M.O.S.S. Discord does it seem that there is a method to set a players sleeping state and such.

pop4959 commented 3 years ago

I don't believe this is exposed in such a way that Essentials would be able to do anything about it. You'll probably have better luck asking Spigot/Paper to add this option to the server.

the-mann commented 3 years ago

It would be possible - you would just check the time of day on a right click on a bed... you wouldn't get in the bed, but it could still work

pop4959 commented 3 years ago

@the-mann Feel free to make a PR if you know how to do it, or point out the specific APIs that make it possible.

cype-dev commented 3 years ago

AFAIK setting setUseBed(Event.Result.ALLOW) in PlayerBedEnterEvent should work, but i haven't tested it myself.