From b05ad4a0e33b7426faf9986e619e707f1909ed7a Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Sun, 28 Feb 2021 17:19:15 +0100 Subject: [PATCH] Initial commit --- data/minecraft/tags/functions/load.json | 1 + data/minecraft/tags/functions/tick.json | 1 + data/tct/functions/ayevote.mcfunction | 2 ++ data/tct/functions/calc.mcfunction | 4 +++ data/tct/functions/decrease.mcfunction | 1 + data/tct/functions/halt.mcfunction | 10 ++++++ data/tct/functions/load.mcfunction | 2 ++ data/tct/functions/notes/down_0.mcfunction | 2 ++ data/tct/functions/notes/down_1.mcfunction | 2 ++ data/tct/functions/notes/down_2.mcfunction | 1 + data/tct/functions/notes/up_0.mcfunction | 2 ++ data/tct/functions/notes/up_1.mcfunction | 2 ++ data/tct/functions/notes/up_2.mcfunction | 1 + data/tct/functions/novote.mcfunction | 2 ++ data/tct/functions/tick.mcfunction | 1 + data/tct/functions/vote_live.mcfunction | 39 ++++++++++++++++++++++ data/tct/functions/vote_nonlive.mcfunction | 38 +++++++++++++++++++++ pack.mcmeta | 6 ++++ 18 files changed, 117 insertions(+) create mode 100644 data/minecraft/tags/functions/load.json create mode 100644 data/minecraft/tags/functions/tick.json create mode 100644 data/tct/functions/ayevote.mcfunction create mode 100644 data/tct/functions/calc.mcfunction create mode 100644 data/tct/functions/decrease.mcfunction create mode 100644 data/tct/functions/halt.mcfunction create mode 100644 data/tct/functions/load.mcfunction create mode 100644 data/tct/functions/notes/down_0.mcfunction create mode 100644 data/tct/functions/notes/down_1.mcfunction create mode 100644 data/tct/functions/notes/down_2.mcfunction create mode 100644 data/tct/functions/notes/up_0.mcfunction create mode 100644 data/tct/functions/notes/up_1.mcfunction create mode 100644 data/tct/functions/notes/up_2.mcfunction create mode 100644 data/tct/functions/novote.mcfunction create mode 100644 data/tct/functions/tick.mcfunction create mode 100644 data/tct/functions/vote_live.mcfunction create mode 100644 data/tct/functions/vote_nonlive.mcfunction create mode 100644 pack.mcmeta diff --git a/data/minecraft/tags/functions/load.json b/data/minecraft/tags/functions/load.json new file mode 100644 index 0000000..efec2a0 --- /dev/null +++ b/data/minecraft/tags/functions/load.json @@ -0,0 +1 @@ +{"values": ["tct:load"]} \ No newline at end of file diff --git a/data/minecraft/tags/functions/tick.json b/data/minecraft/tags/functions/tick.json new file mode 100644 index 0000000..f486bab --- /dev/null +++ b/data/minecraft/tags/functions/tick.json @@ -0,0 +1 @@ +{"values": ["tct:tick"]} \ No newline at end of file diff --git a/data/tct/functions/ayevote.mcfunction b/data/tct/functions/ayevote.mcfunction new file mode 100644 index 0000000..2cef076 --- /dev/null +++ b/data/tct/functions/ayevote.mcfunction @@ -0,0 +1,2 @@ +scoreboard players add AYE mt_vote_balance 1 +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 2 \ No newline at end of file diff --git a/data/tct/functions/calc.mcfunction b/data/tct/functions/calc.mcfunction new file mode 100644 index 0000000..84f53a3 --- /dev/null +++ b/data/tct/functions/calc.mcfunction @@ -0,0 +1,4 @@ +execute as @a[scores={mt_vote_trigger=1}] run function tct:ayevote +execute as @a[scores={mt_vote_trigger=2}] run function tct:novote +execute as @a[scores={mt_vote_trigger=1..2}] run clear @s written_book{certified:votebook} 1 +execute as @a[scores={mt_vote_trigger=1..2}] run scoreboard players reset @s mt_vote_trigger \ No newline at end of file diff --git a/data/tct/functions/decrease.mcfunction b/data/tct/functions/decrease.mcfunction new file mode 100644 index 0000000..041af71 --- /dev/null +++ b/data/tct/functions/decrease.mcfunction @@ -0,0 +1 @@ +scoreboard players remove Remaining mt_vote_balance 1 \ No newline at end of file diff --git a/data/tct/functions/halt.mcfunction b/data/tct/functions/halt.mcfunction new file mode 100644 index 0000000..823a604 --- /dev/null +++ b/data/tct/functions/halt.mcfunction @@ -0,0 +1,10 @@ +scoreboard objectives setdisplay sidebar +scoreboard players reset Remaining mt_vote_balance +execute as @a run clear @s written_book{certified:votebook} +tellraw @a ["",{"text":"Vote >>","bold":true,"color":"dark_green"},{"text":" AYES: ","bold":true,"color":"dark_green"},{"score":{"name":"AYE","objective":"mt_vote_balance"},"bold":true,"color":"white"},{"text":" "},{"text":" NOES: ","bold":true,"color":"red"},{"score":{"name":"NO","objective":"mt_vote_balance"},"bold":true,"color":"white"}] +scoreboard players reset * mt_vote_balance +scoreboard players reset * mt_vote_trigger +team remove green +team remove red +team remove yellow +schedule function tct:notes/down_0 1t \ No newline at end of file diff --git a/data/tct/functions/load.mcfunction b/data/tct/functions/load.mcfunction new file mode 100644 index 0000000..163ecc7 --- /dev/null +++ b/data/tct/functions/load.mcfunction @@ -0,0 +1,2 @@ +scoreboard objectives add mt_vote_balance dummy "Vote results" +scoreboard objectives add mt_vote_trigger trigger \ No newline at end of file diff --git a/data/tct/functions/notes/down_0.mcfunction b/data/tct/functions/notes/down_0.mcfunction new file mode 100644 index 0000000..133edcc --- /dev/null +++ b/data/tct/functions/notes/down_0.mcfunction @@ -0,0 +1,2 @@ +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 1.6 +schedule function tct:notes/down_1 5t \ No newline at end of file diff --git a/data/tct/functions/notes/down_1.mcfunction b/data/tct/functions/notes/down_1.mcfunction new file mode 100644 index 0000000..8b12826 --- /dev/null +++ b/data/tct/functions/notes/down_1.mcfunction @@ -0,0 +1,2 @@ +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 1.2 +schedule function tct:notes/down_2 5t \ No newline at end of file diff --git a/data/tct/functions/notes/down_2.mcfunction b/data/tct/functions/notes/down_2.mcfunction new file mode 100644 index 0000000..2764419 --- /dev/null +++ b/data/tct/functions/notes/down_2.mcfunction @@ -0,0 +1 @@ +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 0.8 \ No newline at end of file diff --git a/data/tct/functions/notes/up_0.mcfunction b/data/tct/functions/notes/up_0.mcfunction new file mode 100644 index 0000000..425699b --- /dev/null +++ b/data/tct/functions/notes/up_0.mcfunction @@ -0,0 +1,2 @@ +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 0.8 +schedule function tct:notes/up_1 5t \ No newline at end of file diff --git a/data/tct/functions/notes/up_1.mcfunction b/data/tct/functions/notes/up_1.mcfunction new file mode 100644 index 0000000..e13f213 --- /dev/null +++ b/data/tct/functions/notes/up_1.mcfunction @@ -0,0 +1,2 @@ +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 1.0 +schedule function tct:notes/up_2 5t \ No newline at end of file diff --git a/data/tct/functions/notes/up_2.mcfunction b/data/tct/functions/notes/up_2.mcfunction new file mode 100644 index 0000000..eb9ba9b --- /dev/null +++ b/data/tct/functions/notes/up_2.mcfunction @@ -0,0 +1 @@ +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 1.6 \ No newline at end of file diff --git a/data/tct/functions/novote.mcfunction b/data/tct/functions/novote.mcfunction new file mode 100644 index 0000000..7f94a51 --- /dev/null +++ b/data/tct/functions/novote.mcfunction @@ -0,0 +1,2 @@ +scoreboard players add NO mt_vote_balance 1 +playsound minecraft:block.note_block.pling master @a ~ ~ ~ 100 1.6 \ No newline at end of file diff --git a/data/tct/functions/tick.mcfunction b/data/tct/functions/tick.mcfunction new file mode 100644 index 0000000..ef89cbd --- /dev/null +++ b/data/tct/functions/tick.mcfunction @@ -0,0 +1 @@ +execute as @a[scores={mt_vote_trigger=1..2}] run function tct:calc \ No newline at end of file diff --git a/data/tct/functions/vote_live.mcfunction b/data/tct/functions/vote_live.mcfunction new file mode 100644 index 0000000..360d462 --- /dev/null +++ b/data/tct/functions/vote_live.mcfunction @@ -0,0 +1,39 @@ +tellraw @a ["",{"text":"Vote >>","bold":true,"color":"dark_green"},{"text":" Vote using the voting book now!","bold":true,"color":"white"}] +scoreboard players reset * mt_vote_balance +scoreboard players reset * mt_vote_trigger +scoreboard players enable @a[tag=eligible] mt_vote_trigger +give @a[tag=eligible] minecraft:written_book{display:{Name:'{"text":"Voting Book","color":"white","bold":true}',Lore:['{"text":"Cast your vote now!"}']},certified:votebook,title:"Voting Book",author:"Kipje",pages:['[{"text":"Cast your vote!\\n Click AYE or NO below.\\n\\n\\n"},{"text":"AYE","color":"dark_green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click to vote AYE on this vote."}]},"clickEvent":{"action":"run_command","value":"/trigger mt_vote_trigger set 1"}},{"text":" | "},{"text":"NO","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click to vote NO on this vote."}]},"clickEvent":{"action":"run_command","value":"/trigger mt_vote_trigger set 2"}}]']} 1 +team add green "Green" +team modify green color dark_green +team add red "Red" +team modify red color red +team add yellow "Yellow" +team modify yellow color yellow +team join green AYE +team join red NO +team join yellow Remaining +scoreboard players set AYE mt_vote_balance 0 +scoreboard players set NO mt_vote_balance 0 +scoreboard players set Remaining mt_vote_balance 20 +scoreboard objectives setdisplay sidebar mt_vote_balance +schedule function tct:notes/up_0 5t +schedule function tct:decrease 1s append +schedule function tct:decrease 2s append +schedule function tct:decrease 3s append +schedule function tct:decrease 4s append +schedule function tct:decrease 5s append +schedule function tct:decrease 6s append +schedule function tct:decrease 7s append +schedule function tct:decrease 8s append +schedule function tct:decrease 9s append +schedule function tct:decrease 10s append +schedule function tct:decrease 11s append +schedule function tct:decrease 12s append +schedule function tct:decrease 13s append +schedule function tct:decrease 14s append +schedule function tct:decrease 15s append +schedule function tct:decrease 16s append +schedule function tct:decrease 17s append +schedule function tct:decrease 18s append +schedule function tct:decrease 19s append +schedule function tct:halt 20s \ No newline at end of file diff --git a/data/tct/functions/vote_nonlive.mcfunction b/data/tct/functions/vote_nonlive.mcfunction new file mode 100644 index 0000000..7b8a1a3 --- /dev/null +++ b/data/tct/functions/vote_nonlive.mcfunction @@ -0,0 +1,38 @@ +tellraw @a ["",{"text":"Vote >>","bold":true,"color":"dark_green"},{"text":" Vote using the voting book now!","bold":true,"color":"white"}] +scoreboard players reset * mt_vote_balance +scoreboard players reset * mt_vote_trigger +scoreboard players enable @a[tag=eligible] mt_vote_trigger +give @a[tag=eligible] minecraft:written_book{display:{Name:'{"text":"Voting Book","color":"white","bold":true}',Lore:['{"text":"Cast your vote now!"}']},certified:votebook,title:"Voting Book",author:"Kipje",pages:['[{"text":"Cast your vote!\\n Click AYE or NO below.\\n\\n\\n"},{"text":"AYE","color":"dark_green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click to vote AYE on this vote."}]},"clickEvent":{"action":"run_command","value":"/trigger mt_vote_trigger set 1"}},{"text":" | "},{"text":"NO","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click to vote NO on this vote."}]},"clickEvent":{"action":"run_command","value":"/trigger mt_vote_trigger set 2"}}]']} 1 +team add green "Green" +team modify green color dark_green +team add red "Red" +team modify red color red +team add yellow "Yellow" +team modify yellow color yellow +team join green AYE +team join red NO +team join yellow Remaining +scoreboard players set AYE mt_vote_balance 0 +scoreboard players set NO mt_vote_balance 0 +scoreboard players set Remaining mt_vote_balance 20 +schedule function tct:notes/up_0 5t +schedule function tct:decrease 1s append +schedule function tct:decrease 2s append +schedule function tct:decrease 3s append +schedule function tct:decrease 4s append +schedule function tct:decrease 5s append +schedule function tct:decrease 6s append +schedule function tct:decrease 7s append +schedule function tct:decrease 8s append +schedule function tct:decrease 9s append +schedule function tct:decrease 10s append +schedule function tct:decrease 11s append +schedule function tct:decrease 12s append +schedule function tct:decrease 13s append +schedule function tct:decrease 14s append +schedule function tct:decrease 15s append +schedule function tct:decrease 16s append +schedule function tct:decrease 17s append +schedule function tct:decrease 18s append +schedule function tct:decrease 19s append +schedule function tct:halt 20s \ No newline at end of file diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..8c6901a --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 6, + "description": "Crafty Table Datapack\nMade by Juris_LLM" + } +} \ No newline at end of file