概览
minecraft:cannot_be_attacked 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 阻止其他实体攻击这个实体。只有带 minecraft:ignore_cannot_be_attacked 的实体仍能打到它。
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:cannot_be_attacked": {}
}