EmeraldEgg
如解锁了emeraldegg:rainbow_pickaxe配方,就执行say hello,world
1.16.3

Jokey_钥匙
进度触发器
minecraft:recipe_unlocked
否则只能exe store+recipe take的值为0检测(

EmeraldEgg
Jokey_钥匙 发表于 2021-1-2 15:17
进度触发器
minecraft:recipe_unlocked
否则只能exe store+recipe take的值为0检测(

具体代码(

Jokey_钥匙

计分板前置自己写(先写命令的
#!data/emeraldegg/functions/tick.mcfunction
  1. #!data/emeraldegg/functions/tick.mcfunction
  2. execute as @a[tag=!unlock] run function emeraldegg:1
复制代码
#!data/emeraldegg/functions/1.mcfunction

  1. execute store result score # temp run recipe take @s emeraldegg:rainbow_pickaxe
  2. execute if score # temp matches 1 run function emeraldegg:2
复制代码
#!data/emeraldegg/functions/2.mcfunction
  1. say hello,world
  2. tag @s add unlock
  3. recipe give @s emeraldegg:rainbow_pickaxe
复制代码



然后进度
#!data/emeraldegg/advancements/rainbow_pickaxe.json

  1. {
  2.     "criteria": {
  3.         "recipe_unlocked":{
  4.             "trigger": "minecraft:recipe_unlocked",
  5.             "conditions": {
  6.                 "recipe": "emeraldegg:rainbow_pickaxe"
  7.             }
  8.         }
  9.     },
  10.     "rewards": {
  11.         "function": "emeraldegg:rainbow_pickaxe"
  12.     }
  13. }
复制代码


#!data/emeraldegg/functions/rainbow_pickaxe.mcfunction
  1. say hello,world
复制代码
没有测试 可能出错 但是思路应该没问题