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

minecraft:barter

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

概览

minecraft:barter 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物在收到一件物品后随机给出一件物品作为交换,比如猪灵用金子交易。需要和 minecraft:behavior.barter 一起使用。

字段

字段类型默认值说明
barter_tablestring""决定返还物品的战利品表路径。
cooldown_after_being_attackedinteger10受伤后多少秒内生物不会交易。

示例

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

BP/entities/<name>.json
{
  "minecraft:barter": {
    "barter_table": "",
    "cooldown_after_being_attacked": 10
  }
}

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