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

minecraft:trade_table

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

概览

minecraft:trade_table 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让玩家通过交易列表文件与实体交易。可用于自定义商人。

字段

字段类型默认值说明
display_namestring""交易界面顶部显示的名称。
tablestring""交易文件的路径,从行为包文件夹开始。
new_screenbooleanfalse为 true 时,使用较新的交易界面。
persist_tradesbooleanfalse为 true 时,生物之后转变为另一种可交易生物时保留交易。
convert_trades_economybooleanfalse为 true 时,生物转变为使用经济交易表的生物时,匹配的交易会带到新列表中。

示例

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

BP/entities/<name>.json
{
  "minecraft:trade_table": {
    "display_name": "",
    "table": "",
    "new_screen": false,
    "persist_trades": false,
    "convert_trades_economy": false
  }
}

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