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:
19
data/tctcoins/functions/diatocoin.mcfunction
Normal file
19
data/tctcoins/functions/diatocoin.mcfunction
Normal file
@@ -0,0 +1,19 @@
|
||||
# Add exchg1 tag for players within distance with 1 diamond minimum
|
||||
execute as @a[distance=..5] run execute store result score @s diaCount run clear @s minecraft:diamond 0
|
||||
execute as @a[distance=..5] run execute if score @s diaCount matches 1.. run tag @s add exchg1
|
||||
|
||||
# Save scores on monetary and player itself
|
||||
execute as @a[tag=exchg1] run scoreboard players add @e[type=minecraft:armor_stand,tag=monetary] diaStore 1
|
||||
execute as @a[tag=exchg1] run scoreboard players add @e[type=minecraft:armor_stand,tag=monetary] tokenCirculation 10
|
||||
execute as @a[tag=exchg1] run scoreboard players add @s tokenOuttake 10
|
||||
|
||||
# Clear diamond and give coins
|
||||
execute as @a[tag=exchg1] run clear @s minecraft:diamond 1
|
||||
give @a[tag=exchg1] minecraft:sunflower{display: {Name: '{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"CraftyCoin"}],"text":""}', Lore: ['{"extra":[{"text":"Certified"}],"text":""}']}, ctcb: "certified"} 10
|
||||
|
||||
# Notify using tellraw of the results
|
||||
tellraw @a[tag=exchg1] ["",{"text":"CTCB Exchange >> ","bold":true,"color":"dark_green"},{"text":"Exchanged 1 diamond for 10 CraftyCoins.","color":"white"}]
|
||||
tellraw @a[distance=..5,tag=!exchg1] ["",{"text":"CTCB Exchange >> ","bold":true,"color":"dark_green"},{"text":"Could not exchange. ","bold":true,"color":"dark_red"},{"text":"Not enough diamonds in your inventory.","color":"white"}]
|
||||
|
||||
# Remove exchange tag
|
||||
tag @a[tag=exchg1] remove exchg1
|
||||
Reference in New Issue
Block a user