From 3b01460786143cb6986156ac70eeebb6daffb529 Mon Sep 17 00:00:00 2001 From: Nincodedo Date: Wed, 16 Aug 2023 17:51:03 -0500 Subject: [PATCH] Fix Day 1 tool time warning --- .../functions/rewards/announce_day1_tool_warning.mcfunction | 6 +++--- .../data/nincodedo/functions/rewards/load.mcfunction | 2 ++ .../ocw-stuff/data/nincodedo/functions/tick.mcfunction | 1 + .../functions/triggers/day1tooltimecheck.mcfunction | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 datapacks/ocw-stuff/data/nincodedo/functions/triggers/day1tooltimecheck.mcfunction diff --git a/datapacks/ocw-stuff/data/nincodedo/functions/rewards/announce_day1_tool_warning.mcfunction b/datapacks/ocw-stuff/data/nincodedo/functions/rewards/announce_day1_tool_warning.mcfunction index 90dcdaf4..3aecdc30 100644 --- a/datapacks/ocw-stuff/data/nincodedo/functions/rewards/announce_day1_tool_warning.mcfunction +++ b/datapacks/ocw-stuff/data/nincodedo/functions/rewards/announce_day1_tool_warning.mcfunction @@ -1,4 +1,4 @@ title @s actionbar [{"score":{"name": "@s","objective": "day1tooldisplay"}},{"text": " minutes remaining on your Day 1 tools"}] -tag @s[scores={day1tooldisplay=15}] add 1stday1toolwarning -tag @s[scores={day1tooldisplay=10}] add 2ndday1toolwarning -tag @s[scores={day1tooldisplay=5}] add 3rdday1toolwarning +tag @s[scores={day1tooldisplay=..15}] add 1stday1toolwarning +tag @s[scores={day1tooldisplay=..10}] add 2ndday1toolwarning +tag @s[scores={day1tooldisplay=..5}] add 3rdday1toolwarning diff --git a/datapacks/ocw-stuff/data/nincodedo/functions/rewards/load.mcfunction b/datapacks/ocw-stuff/data/nincodedo/functions/rewards/load.mcfunction index e6df0531..efcd7903 100644 --- a/datapacks/ocw-stuff/data/nincodedo/functions/rewards/load.mcfunction +++ b/datapacks/ocw-stuff/data/nincodedo/functions/rewards/load.mcfunction @@ -1,4 +1,6 @@ scoreboard objectives add day1toolticks dummy +scoreboard objectives add day1tooldisplay dummy +scoreboard objectives add day1tooltime trigger scoreboard players set day1tooltickinit rhcconfig 24000 scoreboard players set ticktominutes math 1200 diff --git a/datapacks/ocw-stuff/data/nincodedo/functions/tick.mcfunction b/datapacks/ocw-stuff/data/nincodedo/functions/tick.mcfunction index ebecfdb9..dcf06aba 100644 --- a/datapacks/ocw-stuff/data/nincodedo/functions/tick.mcfunction +++ b/datapacks/ocw-stuff/data/nincodedo/functions/tick.mcfunction @@ -1,5 +1,6 @@ execute as @a[scores={bannerplz=1}] at @s run function nincodedo:triggers/givebannerforlocation execute as @a[scores={nopotionsplz=1}] run function nincodedo:triggers/nopotionsplz +execute as @a[scores={day1tooltime=1}] run function nincodedo:triggers/day1tooltimecheck execute as @a[tag=!triggerbannerenabled] run function nincodedo:util/setup_new_player execute if score potionhorn rhcdata matches 1 as @a[tag=!triggernopotionenabled] run scoreboard players enable @s nopotionsplz execute if score potionhorn rhcdata matches 1 as @a[tag=!triggernopotionenabled] run tag @s add triggernopotionenabled diff --git a/datapacks/ocw-stuff/data/nincodedo/functions/triggers/day1tooltimecheck.mcfunction b/datapacks/ocw-stuff/data/nincodedo/functions/triggers/day1tooltimecheck.mcfunction new file mode 100644 index 00000000..3c753908 --- /dev/null +++ b/datapacks/ocw-stuff/data/nincodedo/functions/triggers/day1tooltimecheck.mcfunction @@ -0,0 +1,4 @@ +function nincodedo:rewards/announce_day1_tool_warning + +scoreboard players set @s day1tooltime 0 +scoreboard players enable @s day1tooltime