Health 是当前血量,最大生命由属性决定。只把 Health 设成 100, 实体一生成就会被拉回默认的 20。必须同时改 generic.max_health 属性:{attributes:[{id:"minecraft:max_health",base:100}],Health:100f}可视化配置实体 NBT,生成 /summon 指令。
免费在线数据更新至 26.2
正在加载工具…
这些字段对绝大多数实体都有效,写在 /summon 的第三个参数里。 注意 NBT 的类型后缀不能省:1b 是 byte、1.0f 是 float、1L 是 long。
Health 是当前血量,最大生命由属性决定。只把 Health 设成 100, 实体一生成就会被拉回默认的 20。必须同时改 generic.max_health 属性:{attributes:[{id:"minecraft:max_health",base:100}],Health:100f}1.21 起属性 id 去掉了 generic./horse. 这类前缀,直接写 minecraft:max_health。旧版要写 generic.maxHealth。
# 一只 100 血、不会消失、名字常显的僵尸王
summon zombie ~ ~ ~ {CustomName:{text:"僵尸王",color:"dark_red"},CustomNameVisible:1b,PersistenceRequired:1b,attributes:[{id:"minecraft:max_health",base:100}],Health:100f}
# 一个不动、无敌、隐身的判定用盔甲架
summon armor_stand ~ ~ ~ {NoGravity:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["checkpoint"]}
# 骑在猪身上的骷髅
summon pig ~ ~ ~ {Passengers:[{id:"minecraft:skeleton"}]}
# 带闪电效果的充能苦力怕
summon creeper ~ ~ ~ {powered:1b}PersistenceRequired:1b 可以让它常驻。NoAI:1b 会同时关掉重力与碰撞逻辑;只想让它站着不追人, 可以改用 attributes 把 movement_speed 设为 0。~ ~ ~ 是执行位置,~ ~2 ~ 是正上方两格,^ ^ ^3 是「面朝方向前方 3 格」。只写 Health 会被最大生命值属性打回原值。必须同时写属性:/summon zombie ~ ~ ~ {attributes:[{id:"minecraft:max_health",base:100}],Health:100.0f}。1.21.2 之前的写法是 Attributes:[{Name:"generic.max_health",Base:100}],注意大小写不同。
原版会自然清除远离玩家的怪。在 NBT 里加 PersistenceRequired:1b 就能让它永久留存,例如 /summon zombie ~ ~ ~ {PersistenceRequired:1b}。展示用的怪建议再配 NoAI:1b、Invulnerable:1b 和 Silent:1b。
1.21.5 起用 equipment 复合标签:{equipment:{mainhand:{id:"minecraft:diamond_sword",count:1},head:{id:"minecraft:diamond_helmet",count:1}}}。1.21.4 及更早要用 HandItems 和 ArmorItems 两个列表,顺序是脚→腿→胸→头,别写反。