Skip to content

Commit

Permalink
Got it all working
Browse files Browse the repository at this point in the history
  • Loading branch information
twboom committed Jan 18, 2022
1 parent 5d5b4b3 commit 19a077f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/data/clearlag/functions/clear_items.mcfunction
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kill @e[type=item]
kill @e[type=item]
say @a "Clearing items..."
5 changes: 3 additions & 2 deletions src/data/clearlag/functions/load.mcfunction
Original file line number Diff line number Diff line change
@@ -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
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
1 change: 1 addition & 0 deletions src/data/clearlag/functions/reset.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scoreboard players set timer cl_timer 0
2 changes: 1 addition & 1 deletion src/data/clearlag/functions/tick.mcfunction
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions src/data/clearlag/functions/timer_out.mcfunction
Original file line number Diff line number Diff line change
@@ -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..."
4 changes: 3 additions & 1 deletion src/data/minecraft/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"values": ["timer:load"]
"values": [
"clearlag:load"
]
}
2 changes: 1 addition & 1 deletion src/data/minecraft/tags/functions/tick.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [
"timer:tick"
"clearlag:tick"
]
}

0 comments on commit 19a077f

Please sign in to comment.