diff --git a/minigames/data/prophunt/functions/ping/effect.mcfunction b/minigames/data/prophunt/functions/ping/effect.mcfunction new file mode 100644 index 0000000..9548a75 --- /dev/null +++ b/minigames/data/prophunt/functions/ping/effect.mcfunction @@ -0,0 +1,10 @@ +# Executed as and at the pinging player +# tellraw @a {"text":"prophunt:ping/run"} + + +effect give @s glowing 1 1 true +summon block_display ~ ~ ~ {Glowing:1b,block_state:{Name:"minecraft:air"},Tags:["prophunt.ping","prophunt.ping.new"]} +team join prophunt @e[type=block_display,tag=prophunt.ping.new] +scoreboard players set @ +playsound minecraft:block.note_block.bell master @a[tag=prophunt.is_hunter] ~ ~ ~ 2 1 1 +scoreboard players set @s prophunt.use_item_trigger 0 \ No newline at end of file diff --git a/minigames/data/prophunt/functions/ping/raycast.mcfunction b/minigames/data/prophunt/functions/ping/raycast.mcfunction new file mode 100644 index 0000000..b365090 --- /dev/null +++ b/minigames/data/prophunt/functions/ping/raycast.mcfunction @@ -0,0 +1,7 @@ +# Executed as and at the pinging player +# tellraw @a {"text":"prophunt:ping/raycast"} + +scoreboard players remove #prophunt.ping.raycast ctx 1 +execute if score #prophunt.ping.raycast ctx matches 1.. if block ~ ~ ~ air positioned ^ ^ ^0.5 run function prophunt:ping/raycast +execute unless block ~ ~ ~ air align xyz positioned ~ ~0.5 ~ run function prophunt:ping/effect +execute if score #prophunt.ping.raycast ctx matches ..0 align xyz positioned ~ ~0.5 ~ run function prophunt:ping/effect \ No newline at end of file diff --git a/minigames/data/prophunt/functions/ping/run.mcfunction b/minigames/data/prophunt/functions/ping/run.mcfunction deleted file mode 100644 index 678e44a..0000000 --- a/minigames/data/prophunt/functions/ping/run.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# Executed as and at the pinging player -# tellraw @a {"text":"prophunt:ping/ping"} - -effect give @s glowing 1 1 true -playsound minecraft:block.note_block.bell master @a[tag=prophunt.is_hunter] ~ ~ ~ 2 1 1 -scoreboard players set @s prophunt.use_item_trigger 0 \ No newline at end of file diff --git a/minigames/data/prophunt/functions/ping/trigger.mcfunction b/minigames/data/prophunt/functions/ping/trigger.mcfunction index f135ff5..eb05b7d 100644 --- a/minigames/data/prophunt/functions/ping/trigger.mcfunction +++ b/minigames/data/prophunt/functions/ping/trigger.mcfunction @@ -1,4 +1,5 @@ # Executed globally # tellraw @a {"text":"prophunt:ping/trigger"} -execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..}] at @s run function prophunt:ping/run \ No newline at end of file +execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..}] at @s run scoreboard players set #prophunt.ping.raycast ctx 50 +execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..}] at @s run function prophunt:ping/raycast \ No newline at end of file diff --git a/minigames/data/prophunt/functions/start/start.mcfunction b/minigames/data/prophunt/functions/start/start.mcfunction index e9aad5d..578ad64 100644 --- a/minigames/data/prophunt/functions/start/start.mcfunction +++ b/minigames/data/prophunt/functions/start/start.mcfunction @@ -51,6 +51,12 @@ stopsound @a[team=prophunt] record execute as @a[team=prophunt] at @s run playsound prophunt:theme record @s tellraw @a[team=prophunt] {"text":"Music by Ashot Danielyan","hoverEvent":{"action":"show_text","value":[{"text":"Played on the \"record\" audio source"}]}} +title @a[team=prophunt] times 0 100 20 +title @a[team=prophunt,tag=prophunt.is_prop] title {"text":"Prop","color":"blue","bold":true,"italic":true} +title @a[team=prophunt,tag=prophunt.is_prop] subtitle {"text":"Find a place to hide!","color":"blue"} +title @a[team=prophunt,tag=prophunt.is_hunter] title {"text":"Hunter","color":"red","bold":true,"italic":true} +title @a[team=prophunt,tag=prophunt.is_hunter] subtitle {"text":"Find all the props!","color":"red"} + # execute as @a[team=prophunt] at @s run function #global:animated_title {type:"start"} tp @e[team=prophunt,tag=prophunt.is_hunter] 134 88 59