mirror of
https://codeberg.org/vlw/mc-daynight.git
synced 2026-04-13 03:09:38 +02:00
13 lines
970 B
MCFunction
Executable file
13 lines
970 B
MCFunction
Executable file
# Mtick is invalid
|
|
execute as @e[ name=daynight_entity_daytime, type=armor_stand, x=0.0, y=0.0, z=0.0 ] run execute if score @s daynight_score_runtime_advance_time_mtick matches -1 run say Error: daynight_score_runtime_advance_time_mtick < 0
|
|
execute as @e[ name=daynight_entity_daytime, type=armor_stand, x=0.0, y=0.0, z=0.0 ] run execute if score @s daynight_score_runtime_advance_time_mtick matches -1 run return fail
|
|
|
|
# Store current time
|
|
execute as @e[ name=daynight_entity_daytime, type=armor_stand, x=0.0, y=0.0, z=0.0 ] store result score @s daynight_score_runtime_daytime_tick run time query daytime
|
|
|
|
# Run main function if timer has reached 0
|
|
execute as @e[ name=daynight_entity_daytime, type=armor_stand, x=0.0, y=0.0, z=0.0 ] run execute if score @s daynight_score_runtime_advance_time_mtick matches 0 run function _daynight:main
|
|
|
|
# Decrement timer score and schedule next tick
|
|
function _daynight:decrement_counter
|
|
schedule function _daynight:tick 1t replace
|