Created
July 13, 2024 03:32
-
-
Save TheyCallMeLinux/4f73b38a59c8f0122e7faf1d72f6be80 to your computer and use it in GitHub Desktop.
Revisions
-
TheyCallMeLinux created this gist
Jul 13, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ #!/bin/bash if [ "$#" -ne 1 ]; then echo "Usage: $0 <normal|extended>" exit 1 fi MODE=$1 case $MODE in normal) echo "Setting time to normal mode..." docker exec mcserver rcon-cli gamerule doDaylightCycle true ;; extended) echo "Setting time to extended mode..." docker exec mcserver rcon-cli gamerule doDaylightCycle false # Time steps for a slower cycle, low the sun moves in small increments, high less server impact but the sun is teleporting, lol DAY_LENGTH=$((24000 * 10)) STEP=50 INTERVAL=10 # Adjust this to make the cycle slower or faster CURRENT_TIME=$(docker exec mcserver rcon-cli time query daytime | grep -o '[0-9]*') while true; do docker exec mcserver rcon-cli time add $STEP sleep $INTERVAL done ;; *) echo "Invalid mode. Use 'normal' or 'extended'." exit 1 ;; esac echo "Time setting complete."