
/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 在 Minecraft 中有什麼作用?
讀取或變更實體的屬性(例如最高生命值、速度或攻擊傷害)及其修飾符。
/attribute 的語法是什麼?
基本格式是 /attribute <target> <attribute> base get。所有格式都列在上方。
/attribute 有什麼範例?
/attribute @s minecraft:scale base set 2 — 讓你的體型變為兩倍大(scale 屬性,範圍0.0625到16)。
使用 /attribute 需要作弊嗎?
需要:作弊/op 2。在單人遊戲中請開啟「允許作弊」(或以允許作弊的方式開放區域網路)。