EssentialsX

EssentialsX

2M Downloads

New /sleep command

mart-r opened this issue ยท 6 comments

commented

Feature request

Feature description
A /sleep command that starts a (potentially one-tick) sleep session

How the feature is useful
It would help get rid of those pesky phantoms, at least for a while.

commented

Basically a command for reseting your sleep timer? Maybe /reset-sleep or whatever would fit for that better, but i'm not sure if this is something that should be included in essentials. You can probably find another plugin already doing that.

commented

There are commands such as /heal and /feed. I feel like this falls into the same "category".

Of course there are other possibilities. I just thought the users of this fine plugin might benefit from such a command.

commented

I think a /sleep command would be ambiguous as there's not an easy way to figure out what it does from the name - does it make you instantly fall asleep? Does it make everyone fall asleep? In fact, I'd argue preventing phantoms isn't at all what I'd expect a command called /sleep to do.

I'm not opposed to this, but I agree with @Xeyame that it's probably better suited to another plugin.

commented

I'm not sure that this is easily possible, since as far as I know you actually need a valid bed location to sleep at. If it was possible though, maybe a name like "/rest" would be better, since it is setting your status to rested. I think the only way to add this might be hacky right now though.

It's not all that difficult. All you need to do is Player#setStatistic and set the Statistic.TIME_SINCE_REST to 0.

commented

Good to know, thank you for pointing that out!

commented

I'm not sure that this is easily possible, since as far as I know you actually need a valid bed location to sleep at. If it was possible though, maybe a name like "/rest" would be better, since it is setting your status to rested. I think the only way to add this might be hacky right now though.