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

minecraft:giveable

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

概览

minecraft:giveable 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让玩家把特定物品交给实体,实体会把物品收进物品栏并触发一个事件。

字段

字段类型默认值说明
cooldownDecimal"0.0"两次赠送之间等待的秒数,防止连点刷物品。
itemsList无实体接受的物品。
on_giveString无给予正确物品时触发的事件。

示例

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

BP/entities/<name>.json
{
  "minecraft:giveable": {
    "cooldown": "0.0",
    "items": {},
    "on_give": ""
  }
}

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