
/attribute
作弊 / OP 2Java版 26.3
读取或修改实体的属性(如最大生命值、速度或攻击伤害)及其修饰符。基本格式为 /attribute <target> <attribute> base get;共有12 种语法格式和5 个参数。权限:作弊 / OP 2。
/attribute 语法
游戏数据游戏接受的所有格式。<尖括号> 中的词是需要你填写的参数,其余部分按原样输入。
/attribute <target> <attribute> base get/attribute <target> <attribute> base get <scale>/attribute <target> <attribute> base reset/attribute <target> <attribute> base set <value>/attribute <target> <attribute> get/attribute <target> <attribute> get <scale>/attribute <target> <attribute> modifier add <id> <value> add_multiplied_base/attribute <target> <attribute> modifier add <id> <value> add_multiplied_total/attribute <target> <attribute> modifier add <id> <value> add_value/attribute <target> <attribute> modifier remove <id>/attribute <target> <attribute> modifier value get <id>/attribute <target> <attribute> modifier value get <id> <scale>/attribute 示例
可直接粘贴的示例(需开启作弊)。@s 是你自己,@p 是最近的玩家,@a 是所有玩家,@e 是所有实体。
/attribute @s minecraft:scale base set 2- 让你的体型变为两倍大(scale 属性,范围0.0625到16)。
/attribute @s minecraft:max_health base get- 显示你的基础最大生命值(20 = 10颗心)。
/attribute @s minecraft:scale base reset- 将你的体型恢复正常。
/attribute 参数
每个参数需要填写什么,以及游戏强制的限制。
| 参数 | 类型 | 限制 |
|---|---|---|
<target> | 目标选择器或玩家名(@s、@p、@a、@e、@r) | 单个目标 |
<attribute> | 注册表中的游戏ID | attribute |
<scale> | 数字 | — |
<value> | 数字 | — |
<id> | 带命名空间的ID(minecraft:…) | — |
读取或修改实体的属性(如最大生命值、速度或攻击伤害)及其修饰符。 它有12 种语法格式,可由以下人员执行:作弊 / OP 2。
另请参阅
/attribute 常见问题(Java版 26.3)
我的世界中 /attribute 有什么作用?
读取或修改实体的属性(如最大生命值、速度或攻击伤害)及其修饰符。
/attribute 的语法是什么?
基本格式为 /attribute <target> <attribute> base get。所有格式见上方列表。
/attribute 有什么使用示例?
/attribute @s minecraft:scale base set 2 — 让你的体型变为两倍大(scale 属性,范围0.0625到16)。
使用 /attribute 需要开启作弊吗?
需要:作弊 / OP 2。在单人游戏中打开“允许作弊”(或以允许作弊的方式对局域网开放)。