1. Wiki
  2. /实体
  3. /minecraft:interact

minecraft:interact

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:interact。Get GodCraft

概览

minecraft:interact 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 定义玩家对实体使用物品或点击它时发生什么,比如给羊剪毛。每种互动都可以消耗物品、返还物品并触发事件。

字段

字段类型默认值说明
interactionsInteractionData[]无互动列表,每个都包含条件、按钮文字、物品变化和事件。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:interact": {
    "interactions": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more