I have a modpack that confers certain bonuses for sleeping, but the way sleep percentage works is that if you don't make it to bed before everyone else does, you're out of luck.
To remedy this I'd like to set up a command block that adjusts the playersleeppercentage gamerule automatically so that everyone who is in a bed gets to actually sleep without holding things up if someone decides not to. Unfortunately my knowledge of commands pretty much extends only to mucking about with instantaneous things and I've never tried to set up anything persistent, so I could use some guidance.







