HerobrineXia 5 роки тому
батько
коміт
c49d232304

+ 1 - 0
data/item/functions/shop/check.mcfunction

@@ -1,3 +1,4 @@
+execute if score @s buy_trigger matches 1 at @s unless entity @s[x=-3,z=-63,y=7,dx=20,dy=8,dz=30] run function item:shop/error
 execute if score @s buy_trigger matches 1 if score $state mem matches 0 run function item:shop/buy_apple1
 execute if score @s buy_trigger matches 2 if score $state mem matches 0 run function item:shop/buy_apple2
 execute if score @s buy_trigger matches 3 if score $state mem matches 0 run function item:shop/buy_armor1

+ 6 - 0
data/item/functions/shop/error.mcfunction

@@ -0,0 +1,6 @@
+# 不在购物区域
+# 触发器ID None
+scoreboard players set @s buy_trigger 0
+execute if score $state mem matches 0 run scoreboard players enable @s buy_trigger
+tellraw @s ["",{"text":">> ","color":"red","bold":true},{"text":"你够不着这个商品!","color":"red"}]
+execute at @s run function lib:sounds/error