手冊:minecraft:inventory

出自Minecraft基岩版开发Wiki
數據驅動 實體 > minecraft:inventory
minecraft:inventory
附加包元件
元件所屬
元件型別
元件ID
1941951218

設定實體的物品欄。

模式[編輯]

inventory:
number "inventory_size": opt
enumerated_value "container"<"horse","chest_boat","minecart_chest">
string "container_type": opt
bool "can_be_siphoned_from": opt
bool "private": opt
number "additional_slots_per_strength": opt

結構[編輯]

  •  minecraft:inventory:根物件。
    •  inventory_size:物品欄的大小。
    •  container_type:容器型別。
    •  can_be_siphoned_from:當實體在漏斗上時,容器內物品是否可以被吸取。
    •  additional_slots_per_strength:實體的「動態容器大小權重」[注 1]
    •  private:將實體的容器設為私有[注 2]

範例[編輯]

"minecraft:inventory": {
	"inventory_size": 2,
	"container_type": "container"
}

容器型別[編輯]

原版用例 描述
container 待補充 面向實體會出現名為「開啟」互動按鈕,大約可以相當於把實體當儲物箱開啟。
boat_chest 箱船 箱船的開啟邏輯。
minecart_chest 儲物箱礦車 儲物箱礦車的開啟邏輯。
horse 羊駝商隊羊駝 的開啟邏輯。[注 3]

歷史[編輯]

基岩版
?加入了minecraft:inventory

錯誤[編輯]

關於minecraft:inventory的錯誤在國際版中由錯誤追蹤器維護,請在此回報錯誤。

註釋[編輯]

  1. 即中文Minecraft Wiki在羊駝上寫的「3*Strength」公式中的3,它在基岩版由此元件設定。
  2. 如村民的隱藏物品欄機制。
  3. 馬等原版引用該元件的生物裝備欄格子數也要包含在"inventory_size"元件的值中。