diff --git a/src/data/clearlag/functions/clear_items.mcfunction b/src/data/clearlag/functions/clear_items.mcfunction index 254907c..c2b6952 100644 --- a/src/data/clearlag/functions/clear_items.mcfunction +++ b/src/data/clearlag/functions/clear_items.mcfunction @@ -1 +1,2 @@ -kill @e[type=item] \ No newline at end of file +kill @e[type=item] +say @a "Clearing items..." \ No newline at end of file diff --git a/src/data/clearlag/functions/load.mcfunction b/src/data/clearlag/functions/load.mcfunction index c0e0410..6aa16cf 100644 --- a/src/data/clearlag/functions/load.mcfunction +++ b/src/data/clearlag/functions/load.mcfunction @@ -1,3 +1,4 @@ scoreboard objectives add cl_timer dummy -scoreboard players add timer cl_timer 0 -scoreboard players add timer_goal cl_timer 6000 \ No newline at end of file +scoreboard players set timer cl_timer 0 +scoreboard players add timer_goal cl_timer 0 +execute if score timer_goal cl_timer matches 0 run scoreboard players set timer_goal cl_timer 6000 \ No newline at end of file diff --git a/src/data/clearlag/functions/reset.mcfunction b/src/data/clearlag/functions/reset.mcfunction new file mode 100644 index 0000000..da4f86b --- /dev/null +++ b/src/data/clearlag/functions/reset.mcfunction @@ -0,0 +1 @@ +scoreboard players set timer cl_timer 0 \ No newline at end of file diff --git a/src/data/clearlag/functions/tick.mcfunction b/src/data/clearlag/functions/tick.mcfunction index 9531c70..89de752 100644 --- a/src/data/clearlag/functions/tick.mcfunction +++ b/src/data/clearlag/functions/tick.mcfunction @@ -1,2 +1,2 @@ -scoreboard players add cl_timer cl_timer 1 +scoreboard players add timer cl_timer 1 execute if score timer cl_timer = timer_goal cl_timer run function clearlag:timer_out \ No newline at end of file diff --git a/src/data/clearlag/functions/timer_out.mcfunction b/src/data/clearlag/functions/timer_out.mcfunction index 7623e03..9c0863d 100644 --- a/src/data/clearlag/functions/timer_out.mcfunction +++ b/src/data/clearlag/functions/timer_out.mcfunction @@ -1,3 +1,2 @@ -scoreboard players operation timer cl_timer = timer_goal cl_timer +function clearlag:reset function clearlag:clear_items -say @a "Clearing items..." \ No newline at end of file diff --git a/src/data/minecraft/tags/functions/load.json b/src/data/minecraft/tags/functions/load.json index f79dbe4..a15dfbe 100644 --- a/src/data/minecraft/tags/functions/load.json +++ b/src/data/minecraft/tags/functions/load.json @@ -1,3 +1,5 @@ { - "values": ["timer:load"] + "values": [ + "clearlag:load" + ] } \ No newline at end of file diff --git a/src/data/minecraft/tags/functions/tick.json b/src/data/minecraft/tags/functions/tick.json index dc33d9f..3cd243a 100644 --- a/src/data/minecraft/tags/functions/tick.json +++ b/src/data/minecraft/tags/functions/tick.json @@ -1,5 +1,5 @@ { "values": [ - "timer:tick" + "clearlag:tick" ] } \ No newline at end of file