store_single.mcfunction- execute store result score @s want run clear @s diamond_pickaxe{tags:["want_diamond_pickaxe"]} 0
- execute store result score @s able run clear @s emerald 0
- execute if entity @s[gamemode=creative] run scoreboard players set @s able 65536
- execute if score @s want matches 1.. if score @s able matches 10.. run give @s diamond_pickaxe{Unbreakable:1b, CanDestroy:["diamond_block", "sandstone"]}
- execute if score @s want matches 1.. if score @s able matches ..9 run tellraw @s {"text": "购买失败,缺绿宝石", "color": "red"}
- execute if score @s want matches 1.. if score @s able matches 10.. run clear @s emerald 10
- execute if score @s want matches 1.. run clear @s diamond_pickaxe{tags:["want_diamond_pickaxe"]}
- execute store result score @s want run clear @s diamond_pickaxe{tags:["want_diamond_pickaxe_x"]} 0
- execute store result score @s able run clear @s emerald 0
- execute if entity @s[gamemode=creative] run scoreboard players set @s able 65536
- execute if score @s want matches 1.. if score @s able matches 25.. run give @s diamond_pickaxe{Unbreakable:1b,Enchantments:[{id:"efficiency", lvl:10}], CanDestroy:["diamond_block", "sandstone"]}
- execute if score @s want matches 1.. if score @s able matches ..24 run tellraw @s {"text": "购买失败,缺绿宝石", "color": "red"}
- execute if score @s want matches 1.. if score @s able matches 25.. run clear @s emerald 10
- execute if score @s want matches 1.. run clear @s diamond_pickaxe{tags:["want_diamond_pickaxe_x"]}
- execute store result score @s want run clear @s diamond_sword{tags:["want_diamond_sword"]} 0
- execute store result score @s able run clear @s emerald 0
- execute if entity @s[gamemode=creative] run scoreboard players set @s able 65536
- execute if score @s want matches 1.. if score @s able matches 10.. run give @s diamond_sword{Unbreakable:1b}
- execute if score @s want matches 1.. if score @s able matches ..9 run tellraw @s {"text": "购买失败,缺绿宝石", "color": "red"}
- execute if score @s want matches 1.. if score @s able matches 10.. run clear @s emerald 10
- execute if score @s want matches 1.. run clear @s diamond_sword{tags:["want_diamond_sword"]}
- execute store result score @s want run clear @s diamond_sword{tags:["want_diamond_sword_x"]} 0
- execute store result score @s able run clear @s emerald 0
- execute if entity @s[gamemode=creative] run scoreboard players set @s able 65536
- execute if score @s want matches 1.. if score @s able matches 64.. run give @s diamond_sword{Unbreakable:1b,Enchantments:[{id:"sharpness", lvl:10}]}
- execute if score @s want matches 1.. if score @s able matches ..63 run tellraw @s {"text": "购买失败,缺绿宝石", "color": "red"}
- execute if score @s want matches 1.. if score @s able matches 64.. run clear @s emerald 64
- execute if score @s want matches 1.. run clear @s diamond_sword{tags:["want_diamond_sword_x"]}
- execute store result score @s want run clear @s stick{tags:["want_stick_x"]} 0
- execute store result score @s able run clear @s emerald 0
- execute if entity @s[gamemode=creative] run scoreboard players set @s able 65536
- execute if score @s want matches 1.. if score @s able matches 32.. run give @s stick{Enchantments:[{id:"knockback", lvl:10}]}
- execute if score @s want matches 1.. if score @s able matches ..31 run tellraw @s {"text": "购买失败,缺绿宝石", "color": "red"}
- execute if score @s want matches 1.. if score @s able matches 32.. run clear @s emerald 32
- execute if score @s want matches 1.. run clear @s stick{tags:["want_stick_x"]}
- execute store result score @s want run clear @s splash_potion{tags:["want_slowness_potion"]} 0
- execute store result score @s able run clear @s emerald 0
- execute if entity @s[gamemode=creative] run scoreboard players set @s able 65536
- execute if score @s want matches 1.. if score @s able matches 12.. run give @s splash_potion{Potion:water, CustomPotionEffects:[{Id:2, Amplifier:63, Duration:800}]}
- execute if score @s want matches 1.. if score @s able matches ..11 run tellraw @s {"text": "购买失败,缺绿宝石", "color": "red"}
- execute if score @s want matches 1.. if score @s able matches 12.. run clear @s emerald 12
- execute if score @s want matches 1.. run clear @s splash_potion{tags:["want_slowness_potion"]}
复制代码 store.mcfunction- setblock 8 4 8 chest{CustomName:"\"商店\""}
- replaceitem block 8 4 8 container.1 diamond_pickaxe{tags:["want_diamond_pickaxe"], display:{Lore:["{\"text\":\"普通的钻石镐\", \"color\":\"gold\"}", "{\"text\":\"10绿宝石\", \"color\":\"green\"}"]}}
- replaceitem block 8 4 8 container.2 diamond_pickaxe{tags:["want_diamond_pickaxe_x"], display:{Lore:["{\"text\":\"效率X的钻石镐\", \"color\":\"gold\"}", "{\"text\":\"25绿宝石\", \"color\":\"green\"}"]}, Enchantments:[{}]}
- replaceitem block 8 4 8 container.3 diamond_sword{tags:["want_diamond_sword"], display:{Lore:["{\"text\":\"普通的钻石剑\", \"color\":\"gold\"}", "{\"text\":\"10绿宝石\", \"color\":\"green\"}"]}}
- replaceitem block 8 4 8 container.4 diamond_sword{tags:["want_diamond_sword_x"], display:{Lore:["{\"text\":\"锋利X的钻石剑\", \"color\":\"gold\"}", "{\"text\":\"64绿宝石\", \"color\":\"green\"}"]}, Enchantments:[{}]}
- replaceitem block 8 4 8 container.5 stick{tags:["want_stick_x"], display:{Lore:["{\"text\":\"击退X的木棍\", \"color\":\"gold\"}", "{\"text\":\"32绿宝石\", \"color\":\"green\"}"]}, Enchantments:[{}]}
- replaceitem block 8 4 8 container.6 splash_potion{Potion:"slowness", tags:["want_slowness_potion"], display:{Lore:["{\"text\":\"缓慢药水64\", \"color\":\"gold\"}", "{\"text\":\"12绿宝石\", \"color\":\"green\"}"]}}
- replaceitem block 8 4 8 container.7 sandstone{tags:["want_sandstone"], display:{Lore:["{\"text\":\"砂石方块\", \"color\":\"gold\"}", "{\"text\":\"1绿宝石\", \"color\":\"green\"}"]}}
- replaceitem block 8 4 8 container.8 sandstone{tags:["want_sandstone_16"], display:{Lore:["{\"text\":\"买16个砂石方块\", \"color\":\"gold\"}", "{\"text\":\"16绿宝石\", \"color\":\"green\"}"]}} 16
- scoreboard objectives add want dummy
- scoreboard objectives add able dummy
- execute as @a run function cave:store_single
- scoreboard objectives remove want
- scoreboard objectives remove ableh
复制代码 |