钠钠钠镓
如题。判断玩家的手持物品是否满足#namespace:id
已尝试@a[nbt={SelectedItem:{id:"#namespace:id"}}]和execute if data entity @s SelectedItem{id:"#namespace:id"}均无效

晴路卡
本帖最后由 晴路卡 于 2021-2-13 17:10 编辑

默认你是最新正式版哈 下次报个版本

写个断言:
  1. {
  2.   "condition": "minecraft:entity_properties",
  3.   "entity": "this",
  4.   "predicate": {
  5.     "equipment": {
  6.       "mainhand": {
  7.         "tag": "minecraft:leaves"
  8.       }
  9.     }
  10.   }
  11. }
复制代码
测试用数据包(不需要解压):
test.zip (638 Bytes, 下载次数: 1)

测试指令:
  1. /execute as @a if predicate test:test run say 1
复制代码

效果:当玩家拿着任何一种树叶的时候执行/say 1
标签可以换成其他自定义的

参考页面:
https://zhangshenxing.gitee.io/vanillamodtutorial/#%E6%88%98%E5%88%A9%E5%93%81%E8%A1%A8%E8%B0%93%E8%AF%8D
https://www.mcbbs.net/thread-914817-1-4.html
https://minecraft-zh.gamepedia.com/%E6%88%98%E5%88%A9%E5%93%81%E8%A1%A8%E8%B0%93%E8%AF%8D

第一页 上一页 下一页 最后一页