From 9e1e85623b515cca72fdc18dc5ee34d59ee6511d Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Sat, 18 Sep 2021 19:15:19 +0200 Subject: [PATCH] Added spore blossom, as requested by miss Menace. --- data/craftytable/functions/blossom.mcfunction | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 data/craftytable/functions/blossom.mcfunction diff --git a/data/craftytable/functions/blossom.mcfunction b/data/craftytable/functions/blossom.mcfunction new file mode 100644 index 0000000..492d75c --- /dev/null +++ b/data/craftytable/functions/blossom.mcfunction @@ -0,0 +1,17 @@ +# Add exchg3 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 1.. run tag @s add exchg3 + +# Save scores on monetary and player itself +execute as @a[tag=exchg3] run scoreboard players remove @e[type=minecraft:armor_stand,tag=monetary] tokenCirculation 1 + +# Clear coins and give diamond +execute as @a[tag=exchg3] run clear @s minecraft:sunflower{ctcb:"certified"} 1 +give @a[tag=exchg3] minecraft:spore_blossom 1 + +# Notify using tellraw of the results +tellraw @a[tag=exchg3] ["",{"text":"Spore Exchange >> ","bold":true,"color":"dark_green"},{"text":"Exchanged 1 CraftyCoin for 1 spore blossom.","color":"white"}] +tellraw @a[distance=..5,tag=!exchg3] ["",{"text":"Spore 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=exchg3] remove exchg3 \ No newline at end of file