Bunch of changes, adding functionality requested.

- Added bunch of achievements for democracy
- Added currency exchanges
- Made voting algorithm more efficient
- Added standard meeting hall functionality to the datapack
This commit is contained in:
2021-08-06 01:05:38 +02:00
parent 02ca44bb99
commit aff958e612
22 changed files with 273 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
# Add exchg2 tag for players within distance with 10 coins minimum
execute as @a[distance=..5] run execute store result score @s tokenCount run clear @s minecraft:sunflower{ctcb:"certified"} 0
execute as @a[distance=..5] run execute if score @s tokenCount matches 10.. run tag @s add exchg2
# Save scores on monetary and player itself
execute as @a[tag=exchg2] run scoreboard players remove @e[type=minecraft:armor_stand,tag=monetary] diaStore 1
execute as @a[tag=exchg2] run scoreboard players remove @e[type=minecraft:armor_stand,tag=monetary] tokenCirculation 10
execute as @a[tag=exchg2] run scoreboard players add @s diaOuttake 1
# Clear coins and give diamond
execute as @a[tag=exchg2] run clear @s minecraft:sunflower{ctcb:"certified"} 10
give @a[tag=exchg2] minecraft:diamond 1
# Notify using tellraw of the results
tellraw @a[tag=exchg2] ["",{"text":"CTCB Exchange >> ","bold":true,"color":"dark_green"},{"text":"Exchanged 10 CraftyCoins for 1 diamond.","color":"white"}]
tellraw @a[distance=..5,tag=!exchg2] ["",{"text":"CTCB Exchange >> ","bold":true,"color":"dark_green"},{"text":"Could not exchange. ","bold":true,"color":"dark_red"},{"text":"Not enough CraftyCoins in your inventory.","color":"white"}]
# Remove exchange tag
tag @a[tag=exchg2] remove exchg2