
A solution to have increase daytime without addons and still being able to go to sleep
There are many players who want to have longer days to enjoy building and exploring.
Several solutions exist, but what I found was:
- The "Longer Days" addon is broken, at least when we tried it on our server. Day didnt progress at all after a while or very unreliably. Didnt really look into other addons as they were quite outdated.
- The common solution using command blocks and
time addcommands works, but since it requires to disable the day/night cycle, players will not be able to go to sleep normally.
So I have come up with another solution based on command blocks that allows to...
- Increase day length to your liking
- Keep night length original
- Still be able to go to sleep to skip night
I don't know if a similar solution has been showcased before, but I thought I'd just share it.
Prerequisites:
- Turn off day/night cycle off initially:
/gamerule dodaylightcycle false - Turn off command block output to prevent chat spam:
/gamerule commandblockoutput false - Obviously, cheats need to be enabled and you need have the operator role.
Overview image:
The command blocks are numbered for reference below.
Guide:
- The redstone contraption will not be explained in detail. It's simple. Basically, the daylight sensor powers command blocks [1] and [3] during the day. When it turns night, it powers command block [2]. It will never power all command blocks at the same time, which is important.
- Command block [1] is responsible for progressing the day and is configured as follows:
- Type: Repeat
- Condition: Unconditional
- Redstone: Needs Redstone
- Execute on First Tick: True
- Delay in Ticks: 2 (this will make the day twice as long)
- Command:
/time add 1
- Command block [3] is responsible for disabling the day/night cycle once night is over so we can manually progress the day, and configured as follows:
- Type: Impulse
- Condition: Unconditional
- Redstone: Needs Redstone
- Delay in Ticks: 0
- Command:
/gamerule dodaylightcycle false
- Command block [2] is responsible for enabling the day/night cycle once night begins, so the night can progress as usual and going to sleep works, configured as follows:
- Type: Impulse
- Condition: Unconditional
- Redstone: Needs Redstone
- Delay in Ticks: 0
- Command:
/gamerule dodaylightcycle true
- When you finished building and setting up the command blocks, you could build bedrock blocks around the contraption to prevent unintended things to happen to it (you can also roof it with bedrock, just make sure the daylight sensor can still get light!)
- Important: In order to have the "clock" running when it is outside of the simulation distance, you need to add a ticking area:
- Execute command:
/tickingarea add circle ~ ~ ~ 2 TimeEngine - The ticking area could probably be optimized regarding its size. I am not experienced with them.
- Execute command:
With this setup, your days will be twice as long while night stays the same as originally. You can also still go to sleep normally. You can also still use commands such as /time set day.
I havent found any issues with this solution. Hope it helps someone and please let me know if it works for you! :)
Edit:
- This solution does not (yet?) account for sleeping during daytime while a thunderstorm is active. If anyone has ideas how to make this possible reliably, please let me know.
Edit 2:
- With this exact setup, you will be able to go to sleep once it's fully night only (so the sensor turns fully off). Normally, players can go to sleep slightly earlier, so when there is still some light that a sensor would detect. To improve this aspect of the "device" and allow yourself to go to bed earlier like in "vanilla" day/night cycles, you can add redstone between the sensor and the repeater. I suggest 6 redstone. This should allow you to go to sleep and skip night at the same time as in "vanilla".
u/FunNegotiation423 — 8 days ago