It's MIT-licensed, so you can use it in your projects.
A score that stores how many ticks the player last slept.
You can use /execute if function ohsoeepy:can_player_sleep
to check if the player can sleep. It checks for these conditions:
- There isn't a monster nearby (8 blocks horizontal, 5 blocks vertical)*
- The player isn't poisoned, on fire or starving
* A select list of mobs, but some mobs don't have special cases (All endermen count, and killer bunnies aren't included)
List of functions that get run when the player wakes up.
Located at ohsoeepy/tags/functions/player_woke_up.json