概览
minecraft:transformation 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 把实体变成另一种实体,就像村民变成僵尸村民。在需要变化时通过事件添加它。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
add | JSON Object | 无 | 转变后要添加到新实体上的组件组。 |
begin_transform_sound | String | 无 | 转变开始时播放的声音。 |
delay | JSON Object | 无 | 变化发生前等待的设置。 |
drop_equipment | Boolean | "false" | 为 true 时,实体会掉落所有穿戴或手持的物品。 |
drop_inventory | Boolean | "false" | 为 true 时,实体会掉落物品栏中的物品。 |
into | String | 无 | 变成的实体,可附带事件,比如 minecraft:zombie<minecraft:as_adult>。 |
keep_level | Boolean | "false" | 为 true 时,商人转变后保留交易等级。 |
keep_owner | Boolean | "false" | 为 true 时,已驯服的实体转变后保留主人。 |
preserve_equipment | Boolean | "false" | 为 true 时,新实体保留旧实体的装备。 |
transformation_sound | String | 无 | 转变完成时播放的声音。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:transformation": {
"add": {},
"begin_transform_sound": "",
"delay": {},
"drop_equipment": "false",
"drop_inventory": "false",
"into": "",
"keep_level": "false",
"keep_owner": "false"
}
}