Inventory Slot Minecraft
2021年4月7日Register here: http://gg.gg/oydjj
Minecraft displays the player inventory differently, according to how the window was opened. Ranges of slot indices vary in meaning between different “windows”. The Open Window packet indicates which window is being opened according to:
*Inventory Slot Co-ordinates
*See More Results
*Inventory Slot Plugin Minecraft
*2Chest
*4Furnace
See full list on minecraft.gamepedia.com.
*Browse and download Minecraft Inventory Texture Packs by the Planet Minecraft community.
*This page was last edited on 15 April 2020, at 21:16. Content is available under CC BY-NC-SA 3.0 unless otherwise noted. Game content and materials are trademarks and copyrights of their respective publisher and its licensors.Window TypeDescriptionminecraft:generic_9x1A 1-row inventory, not used by the notchian server.minecraft:generic_9x2A 2-row inventory, not used by the notchian server.minecraft:generic_9x3General-purpose 3-row inventory. Used by Chest, minecart with chest, ender chest, and barrelminecraft:generic_9x4A 4-row inventory, not used by the notchian server.minecraft:generic_9x5A 5-row inventory, not used by the notchian server.minecraft:generic_9x6General-purpose 6-row inventory, used by large chests.minecraft:generic_3x3General-purpose 3-by-3 square inventory, used by Dispenser and Dropperminecraft:anvilAnvilminecraft:beaconBeaconminecraft:blast_furnaceBlast Furnaceminecraft:brewing_standBrewing standminecraft:craftingCrafting tableminecraft:enchantmentEnchantment tableminecraft:furnaceFurnaceminecraft:grindstoneGrindstoneminecraft:hopperHopper or minecart with hopperminecraft:lecternLecternminecraft:loomLoomminecraft:merchantVillager, Wandering Traderminecraft:shulker_boxShulker boxminecraft:smokerSmokerminecraft:cartographyCartography Tableminecraft:stonecutterStonecutterThe following information needs to be added to this page:Most of the inventories new to 1.14 have buttons, which are probably implemented using Protocol#Click Window Button. This needs to be confirmed and the button IDs should be checked.
The slot number is calculated starting at 0, counting up through the window’s unique slots, and then counting through the players inventory.
For all windows, the slot in the upper-left corner of the player’s inventory is slot n where n is the number of unique slots, and slot number -999 is always used for clicking outside the window.
The default inventory window, which is never explicitly opened by the server, has 10 unique slots.
Rectangular regions are always indexed starting with the upper-left corner and scanning across rows. If a window has a crafting region, the output slot is always slot 0 followed immediately by the input region.
Each window type is described in the following sections. All slot index ranges are inclusive and reflect the indices observed in the Minecraft protocol.
For the window properties (additional data in each window, e.g. smelting progress or enchantments), refer to the table in the Window Property packet.
Using -1 as slot index and as window id will set the cursor item (the stack dragged with the mouse).Player InventoryInventory slots
This is the inventory window that the player can always open, typically by pressing E since Beta 1.4. Before, you had to press I.Slot rangeDescription0crafting output1–42×2 crafting input (1 + x + 2 * y)5–8armor (head, chest, legs, feet)9–35main inventory36–44hotbar45Offhand slot
Note that this is different from inventory items stored in a player.dat file. This may help: https://gist.github.com/459a1691c3dd751db160ChestChest slots
This is the window that is opened when the player right-clicks on a single chest block.Slot rangeDescription0–26chest27–53main inventory54–62hotbarDouble/large chest slotsLarge chest
This is the window that is opened when the player right-clicks on a double chest block (two adjacent chest blocks).Slot rangeDescription0–53chest54–80main inventory81–89hotbar
It is possible to receive different ’Number Of Slots’ parameters than those two. In vanilla, using /setblock four times around a chest and then opening the middle chest will open a window with 5*27 chest slots. Some custom servers will send chest inventories with other sizes, usually ranging from 1 row to 6 rows. These may be used for custom GUIs. It is thus important to correctly use the ’Number Of Slots’ parameter in the open window packet to determine the number of rows in the chest, rather than hardcoding what constitutes a regular chest or a large chest.Crafting tableCrafting table slots
This is the window that is opened when the player right-clicks on a workbench.Slot rangeDescription0crafting output1–93×3 crafting input (1 + x + 3 * y)10–36main inventory37–45hotbar
If the ’Number Of Slots’ parameter is not set to 0, the opened window will behave like a container window.FurnaceFurnace slots
The window that appears when a furnace is right-clicked.Slot rangeDescription0ingredient1fuel2output3–29main inventory30–38hotbar
If the ’Number Of Slots’ parameter is inferior to 3, placing an item in a slot may crash the client.Blast FurnaceBlast Furnace slots
The GUI that appears when a blast furnace is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.Slot rangeDescription0ingredient1fuel2output3–29main inventory30–38hotbarSmokerSmoker slots
The GUI that appears when a smoker is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.Slot rangeDescription0ingredient1fuel2output3–29main inventory30–38hotbarDispenserDispenser/dropper slots
The inventory that appears when a dispenser or dropper is opened.Slot rangeDescription0–83×3 dispenser contents (x + 3 * y)9–35main inventory36-44hotbar
If the ’Number Of Slots’ parameter is inferior to 9, placing an item in a slot may crash the client.Enchantment TableEnchantment table slots
The inventory of an enchantment table. The enchant buttons trigger a Enchant item packet.Slot rangeDescription0item to enchant1lapis lazuli slot2–28main inventory29–37hotbarBrewing standBrewing stand slots
The GUI that appears when a brewing stand is opened.Slot rangeDescription0-2bottles/potions3potion ingredient4blaze powder5-31main inventory32-40hotbarVillager tradingMerchant slots
The GUI that appears when a villager is right-clicked. Note that if the villager only requires one item, you can put it in either (or both) slots.Slot rangeDescription0-1input items2result3–29main inventory30–38hotbarBeaconBeacon slots
The window that appears when a beacon is right-clicked.Slot rangeDescription0payment item1–27main inventory28–36hotbarAnvilAnvil slotsSlot rangeDescription0first item1second item2result3–29main inventory30–38hotbarHopperHopper slots
The window that appears when a hopper or hopper minecart is opened.Slot rangeDescription0-4hopper slots5–31main inventory32–40hotbarShulker boxShulker box slots
This is the window that is opened when the player right-clicks on a shulker box chest.Slot rangeDescription0–26box slots27–53main inventory54–62hotbarLlamaLlama slots
The inventory that appears when a tamed llama is right-clicked and has a chest, or when the player’s inventory is opened while riding a tamed llama. Depending on the value of the strength field, the number of chest rows may vary (max is 5, so 15 slots).
There still is a saddle slot, even though it cannot be used and is invisible.
Slot positions within the llama inventory vary - slot 2 may be at (1,0) or at (0,1) depending on the number of columns.Slot rangeDescription0saddle1carpet2-(2+3*Strength)llama inventory(2+3*Strength)+1-(2+3*Strength)+27player inventory(2+3*Strength)+28-(2+3*Strength)+35hotbar
*
Unchested llama
*
Llama with strength 1
*
Llama with strength 2
*
Llama with strength 3
*
Llama with strength 4
*
Llama with strength 5HorseHorse slots
The window for when a tamed horse is right-clicked or the player’s inventory is opened while riding a horse.Slot rangeDescription0saddle1armor2–28main inventory29–37hotbar
*
Horse slots
*
Skeleton horse slots
*
Zombie horse slotsDonkeyDonkey slots
The inventory that appears when a tamed donkey (or mule?) is right-clicked, or when the player’s inventory is opened while riding a tamed donkey or mule.
There still is an armor slot, even though it cannot be used and is invisible.Slot rangeDescription0saddle1armor2–16donkey inventory17–43 (2-28 if unchested)player inventory44–52 (29-37 if unchested)hotbar
*
Unchested donkey
*
Chested donkey
*
Unchested mule
*
Chested muleCartography TableCartography table slots
The GUI that appears when a cartography table is opened.Slot rangeDescription0map1paper2output3–29main inventory30–38hotbarGrindstoneGrindstone slotsSlot rangeDescription0first item1second item2result3–29main inventory30–38hotbarLecternLectern UI
This is a regular container, unlike with held books opened via Protocol#Open Book.The following information needs to be added to this page:Is the player inventory also included on this?
Slot rangeDescription0book1–27main inventory?28–36hotbar?LoomLoom slotsSlot rangeDescription0banner1dye2pattern3result4–30main inventory31–39hotbarStonecutterStonecutter slotsSlot rangeDescription0input1result2–28main inventory29–37hotbarRetrieved from ’https://wiki.vg/index.php?title=Inventory&oldid=14899’< CommandsThis page contains information about features that have been removed in the latest development versions.These features are present in the current version, but may be removed when the next update is released.RestrictionsFirst introduced
Java Edition 1.8 (14w26a) PE 1.0.5 (PE alpha 1.0.5.0)
Replaces items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs) with the given item(s).Syntax[edit]
*Java Editionreplaceitem block <pos> <slot> <item> [<count>]replaceitem entity <targets> <slot> <item> [<count>]
*Bedrock Editionreplaceitem block <position: x y z> slot.container <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]replaceitem block <position: x y z> slot.container <slotId: int> <oldItemHandling: ReplaceMode> <itemName: Item> [amount: int] [data: int] [components: json]replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <oldItemHandling: ReplaceMode> <itemName: Item> [amount: int] [data: int] [components: json]Arguments[edit]
JE: <pos>: block_posBE: position: x y z: CommandPositionIn Java Edition, it must be a block position composed of <x>, <y> and <z>, each of which must be an integer or tilde and caret notation.In Bedrock Edition, it must be a three-dimensional coordinates composed of <x>, <y> and <z>, each of which must be a floating-point number or tilde and caret notation.Specifies the position of the block to be modified.
JE: <targets>: entityBE: target: target: CommandSelector<Actor>Must be a player name, a target selector or a UUID[Java Edition only]. Specifies one or more entities to modify.
JE: <slot>: item_slotBE: slotType: EntityEquipmentSlot: EquipmentSlot, slot.container and <slotId: int>: intSpecifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.In Bedrock Edition, slotId: int must be a 32-bit integer number. And it must be between -2147483648 and 2147483647 (inclusive).For blocks, must be container.<slot_number> (BE: slot.container <slotId: int>) where <slot_number> or <slotId: int> is replaced with a number specifying the slot.
*Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest’s top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
*A brewing stand’s bottom slots are numbered 0 to 2 from left to right, its top slot is 3 and the fuel slot is 4.
*A furnace’s slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.Other blocks which hold items but don’t have inventory GUIs (flower pots and jukeboxes) can only be changed with /data.For entities, must be one of the following, where slot number or slot id is replaced with a number specifying the slot:Inventory Slot Co-ordinatesSlotSlot NumbersRestrictionsarmor.chest(BE: slot.armor.chest <slotId: int>)any number[Bedrock Edition only]armor stands, mobs, and players only (though not all mobs will show or make use of the items)armor.feet(BE: slot.armor.feet <slotId: int>)any number[Bedrock Edition only]armor.head(BE: slot.armor.head <slotId: int>)any number[Bedrock Edition only]armor.legs(BE: slot.armor.legs <slotId: int>)any number[Bedrock Edition only]weapon.mainhand(BE: slot.weapon.mainhand <slotId: int>)any number[Bedrock Edition only]weapon.offhand(BE: slot.weapon.offhand <slotId: int>)any number[Bedrock Edition only]container.<slot_number>(BE: slot.container <slotId: int>)0–53players, item frames[Java Edition only] (slot 0), and minecarts onlyenderchest.<slot_number>(BE: slot.enderchest <slotId: int>)0–26players onlyhotbar.<slot_number>(BE: slot.hotbar <slotId: int>)0–8inventory.<slot_number>(BE: slot.inventory <slotId: int>)0–26horse.saddle(BE: slot.saddle <slotId: int>)any number[Bedrock Edition only]horses, donkeys, and mules only; <item> or itemName: Item must be a saddlehorse.chest[Java Edition only]donkeys, and mules only; <item> must be a chesthorse.armor(BE: slot.armor <slotId: int>)any number[Bedrock Edition only]horses and llamas only; <item> or itemName: Item must be a type of horse armor (if a horse) or a carpet (if a llama)horse.<slot_number>(BE: slot.chest <slotId: int>)0–14donkeys and mules with chests onlyvillager.<slot_number>(BE: slot.inventory <slotId: int>)0–7villagers onlySee More Results
JE: <item>: item_stackBE: itemName: Item: CommandItemSpecifies the item to be placed in the block or entity’s inventory slot.Inventory Slot Plugin Minecraft
JE: <count>: integerBE: amount: int: intMust be a 32-bit integer number. In Java Edition, it must be between -2147483648 and 2147483647 (inclusive). And it must be between 1 and 64 (inclusive).Specifies the number of items to be placed in the block or entity’s inventory slot.
BE: data: int: intMust be a 32-bit integer number. It must be between -2147483648 and 2147483647 (inclusive).Specifies the item data for the item(s) to be placed in the block or entity’s inventory slot. Values which are invalid for the specified item id will default to 0. If not specified, defaults to 0.
BE: components: json: Json::ValueMust be a JSON Object.Specifies the item components. Like data tags but supports only minecraft:can_place_on, minecraft:can_destroy, minecraft:item_lock, and minecraft:keep_on_death functions (see Commands/give#Examples)
BE: oldItemHandling: ReplaceModeMust be one of:destroy - Directly replaces items ignoring the original items in the specified slot.keep - Does not replace items if an item occupies that slot.Result[edit]CommandTriggerJava EditionBedrock Editionanythe arguments are not specified correctly Unparseable Failed<count> exceeds the stack limit of the specified item Failed Successful/replaceitem block ...if the specified block is not a container Failedif the specified block does not have the specified slot/replaceitem entity ...if <targets> or target: target fails to resolve to one or more entities (named players must be online)if none of the targets have the specified slot (for example, zombies don’t have horse.armor)if specified item cannot be place into the specified slot of any targeted entity(for example, place a stone into armor.chest of a player)/replaceitem ... keepif an item occupies the specified slot in keep mode N/AanyOn successReplaces the items in the specified slot with the specified items (previous items in that slot are lost).Output[edit]CommandEditionSituationSuccess Count/execute store success .../execute store result ...anyJava EditionOn fail000/replaceitem block ...On success111/replaceitem entity ...On success11the number of entities whose items are successfully replacedanyBedrock EditionOn fail0N/AN/A/replaceitem block ...On success1N/AN/A/replaceitem entity ...On successthe number of entities whose items are successfully replacedN/AN/AExamples[edit]
*To replace the items in the bottom-right slot of a single chest two block above with four spruce saplings:
*replaceitem block ~ ~2 ~ container.26 minecraft:spruce_sapling 4[Java Edition only]
*replaceitem block ~ ~2 ~ slot.container 26 sapling 4 1[Bedrock Edition only]
*To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
*replaceitem entity @p hotbar.8 minecraft:spruce_sapling 4[Java Edition only]
*replaceitem entity @p slot.hotbar 8 sapling 4 1[Bedrock Edition only]History[edit]Java Edition1.814w26aAdded /replaceitem.1.1418w43a/replaceitem can now be used on item frames.Upcoming Java Edition1.1720w46aRemoved /replaceitem. Replaced with /item replace.Pocket Edition1.0.5alpha 1.0.5.0Added /replaceitem.1.1.0alpha 1.1.0.0CanPlaceOn and CanDestroy functions are now supported for /replaceitem.Bedrock Edition1.16.0beta 1.16.0.55 Added new overload for /replaceitem with an option for destroy or keep.See also[edit]
*/blockdata — can also replace items in a container
*/entitydata — can also replace items in a mob’s inventory, or modify the drop chances of armor and weapons
*/give — give items to players without specifying specific inventory slots or overwriting other items Retrieved from ’https://minecraft.gamepedia.com/Commands/replaceitem?oldid=1781451’
Register here: http://gg.gg/oydjj
https://diarynote.indered.space
Minecraft displays the player inventory differently, according to how the window was opened. Ranges of slot indices vary in meaning between different “windows”. The Open Window packet indicates which window is being opened according to:
*Inventory Slot Co-ordinates
*See More Results
*Inventory Slot Plugin Minecraft
*2Chest
*4Furnace
See full list on minecraft.gamepedia.com.
*Browse and download Minecraft Inventory Texture Packs by the Planet Minecraft community.
*This page was last edited on 15 April 2020, at 21:16. Content is available under CC BY-NC-SA 3.0 unless otherwise noted. Game content and materials are trademarks and copyrights of their respective publisher and its licensors.Window TypeDescriptionminecraft:generic_9x1A 1-row inventory, not used by the notchian server.minecraft:generic_9x2A 2-row inventory, not used by the notchian server.minecraft:generic_9x3General-purpose 3-row inventory. Used by Chest, minecart with chest, ender chest, and barrelminecraft:generic_9x4A 4-row inventory, not used by the notchian server.minecraft:generic_9x5A 5-row inventory, not used by the notchian server.minecraft:generic_9x6General-purpose 6-row inventory, used by large chests.minecraft:generic_3x3General-purpose 3-by-3 square inventory, used by Dispenser and Dropperminecraft:anvilAnvilminecraft:beaconBeaconminecraft:blast_furnaceBlast Furnaceminecraft:brewing_standBrewing standminecraft:craftingCrafting tableminecraft:enchantmentEnchantment tableminecraft:furnaceFurnaceminecraft:grindstoneGrindstoneminecraft:hopperHopper or minecart with hopperminecraft:lecternLecternminecraft:loomLoomminecraft:merchantVillager, Wandering Traderminecraft:shulker_boxShulker boxminecraft:smokerSmokerminecraft:cartographyCartography Tableminecraft:stonecutterStonecutterThe following information needs to be added to this page:Most of the inventories new to 1.14 have buttons, which are probably implemented using Protocol#Click Window Button. This needs to be confirmed and the button IDs should be checked.
The slot number is calculated starting at 0, counting up through the window’s unique slots, and then counting through the players inventory.
For all windows, the slot in the upper-left corner of the player’s inventory is slot n where n is the number of unique slots, and slot number -999 is always used for clicking outside the window.
The default inventory window, which is never explicitly opened by the server, has 10 unique slots.
Rectangular regions are always indexed starting with the upper-left corner and scanning across rows. If a window has a crafting region, the output slot is always slot 0 followed immediately by the input region.
Each window type is described in the following sections. All slot index ranges are inclusive and reflect the indices observed in the Minecraft protocol.
For the window properties (additional data in each window, e.g. smelting progress or enchantments), refer to the table in the Window Property packet.
Using -1 as slot index and as window id will set the cursor item (the stack dragged with the mouse).Player InventoryInventory slots
This is the inventory window that the player can always open, typically by pressing E since Beta 1.4. Before, you had to press I.Slot rangeDescription0crafting output1–42×2 crafting input (1 + x + 2 * y)5–8armor (head, chest, legs, feet)9–35main inventory36–44hotbar45Offhand slot
Note that this is different from inventory items stored in a player.dat file. This may help: https://gist.github.com/459a1691c3dd751db160ChestChest slots
This is the window that is opened when the player right-clicks on a single chest block.Slot rangeDescription0–26chest27–53main inventory54–62hotbarDouble/large chest slotsLarge chest
This is the window that is opened when the player right-clicks on a double chest block (two adjacent chest blocks).Slot rangeDescription0–53chest54–80main inventory81–89hotbar
It is possible to receive different ’Number Of Slots’ parameters than those two. In vanilla, using /setblock four times around a chest and then opening the middle chest will open a window with 5*27 chest slots. Some custom servers will send chest inventories with other sizes, usually ranging from 1 row to 6 rows. These may be used for custom GUIs. It is thus important to correctly use the ’Number Of Slots’ parameter in the open window packet to determine the number of rows in the chest, rather than hardcoding what constitutes a regular chest or a large chest.Crafting tableCrafting table slots
This is the window that is opened when the player right-clicks on a workbench.Slot rangeDescription0crafting output1–93×3 crafting input (1 + x + 3 * y)10–36main inventory37–45hotbar
If the ’Number Of Slots’ parameter is not set to 0, the opened window will behave like a container window.FurnaceFurnace slots
The window that appears when a furnace is right-clicked.Slot rangeDescription0ingredient1fuel2output3–29main inventory30–38hotbar
If the ’Number Of Slots’ parameter is inferior to 3, placing an item in a slot may crash the client.Blast FurnaceBlast Furnace slots
The GUI that appears when a blast furnace is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.Slot rangeDescription0ingredient1fuel2output3–29main inventory30–38hotbarSmokerSmoker slots
The GUI that appears when a smoker is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.Slot rangeDescription0ingredient1fuel2output3–29main inventory30–38hotbarDispenserDispenser/dropper slots
The inventory that appears when a dispenser or dropper is opened.Slot rangeDescription0–83×3 dispenser contents (x + 3 * y)9–35main inventory36-44hotbar
If the ’Number Of Slots’ parameter is inferior to 9, placing an item in a slot may crash the client.Enchantment TableEnchantment table slots
The inventory of an enchantment table. The enchant buttons trigger a Enchant item packet.Slot rangeDescription0item to enchant1lapis lazuli slot2–28main inventory29–37hotbarBrewing standBrewing stand slots
The GUI that appears when a brewing stand is opened.Slot rangeDescription0-2bottles/potions3potion ingredient4blaze powder5-31main inventory32-40hotbarVillager tradingMerchant slots
The GUI that appears when a villager is right-clicked. Note that if the villager only requires one item, you can put it in either (or both) slots.Slot rangeDescription0-1input items2result3–29main inventory30–38hotbarBeaconBeacon slots
The window that appears when a beacon is right-clicked.Slot rangeDescription0payment item1–27main inventory28–36hotbarAnvilAnvil slotsSlot rangeDescription0first item1second item2result3–29main inventory30–38hotbarHopperHopper slots
The window that appears when a hopper or hopper minecart is opened.Slot rangeDescription0-4hopper slots5–31main inventory32–40hotbarShulker boxShulker box slots
This is the window that is opened when the player right-clicks on a shulker box chest.Slot rangeDescription0–26box slots27–53main inventory54–62hotbarLlamaLlama slots
The inventory that appears when a tamed llama is right-clicked and has a chest, or when the player’s inventory is opened while riding a tamed llama. Depending on the value of the strength field, the number of chest rows may vary (max is 5, so 15 slots).
There still is a saddle slot, even though it cannot be used and is invisible.
Slot positions within the llama inventory vary - slot 2 may be at (1,0) or at (0,1) depending on the number of columns.Slot rangeDescription0saddle1carpet2-(2+3*Strength)llama inventory(2+3*Strength)+1-(2+3*Strength)+27player inventory(2+3*Strength)+28-(2+3*Strength)+35hotbar
*
Unchested llama
*
Llama with strength 1
*
Llama with strength 2
*
Llama with strength 3
*
Llama with strength 4
*
Llama with strength 5HorseHorse slots
The window for when a tamed horse is right-clicked or the player’s inventory is opened while riding a horse.Slot rangeDescription0saddle1armor2–28main inventory29–37hotbar
*
Horse slots
*
Skeleton horse slots
*
Zombie horse slotsDonkeyDonkey slots
The inventory that appears when a tamed donkey (or mule?) is right-clicked, or when the player’s inventory is opened while riding a tamed donkey or mule.
There still is an armor slot, even though it cannot be used and is invisible.Slot rangeDescription0saddle1armor2–16donkey inventory17–43 (2-28 if unchested)player inventory44–52 (29-37 if unchested)hotbar
*
Unchested donkey
*
Chested donkey
*
Unchested mule
*
Chested muleCartography TableCartography table slots
The GUI that appears when a cartography table is opened.Slot rangeDescription0map1paper2output3–29main inventory30–38hotbarGrindstoneGrindstone slotsSlot rangeDescription0first item1second item2result3–29main inventory30–38hotbarLecternLectern UI
This is a regular container, unlike with held books opened via Protocol#Open Book.The following information needs to be added to this page:Is the player inventory also included on this?
Slot rangeDescription0book1–27main inventory?28–36hotbar?LoomLoom slotsSlot rangeDescription0banner1dye2pattern3result4–30main inventory31–39hotbarStonecutterStonecutter slotsSlot rangeDescription0input1result2–28main inventory29–37hotbarRetrieved from ’https://wiki.vg/index.php?title=Inventory&oldid=14899’< CommandsThis page contains information about features that have been removed in the latest development versions.These features are present in the current version, but may be removed when the next update is released.RestrictionsFirst introduced
Java Edition 1.8 (14w26a) PE 1.0.5 (PE alpha 1.0.5.0)
Replaces items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs) with the given item(s).Syntax[edit]
*Java Editionreplaceitem block <pos> <slot> <item> [<count>]replaceitem entity <targets> <slot> <item> [<count>]
*Bedrock Editionreplaceitem block <position: x y z> slot.container <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]replaceitem block <position: x y z> slot.container <slotId: int> <oldItemHandling: ReplaceMode> <itemName: Item> [amount: int] [data: int] [components: json]replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <oldItemHandling: ReplaceMode> <itemName: Item> [amount: int] [data: int] [components: json]Arguments[edit]
JE: <pos>: block_posBE: position: x y z: CommandPositionIn Java Edition, it must be a block position composed of <x>, <y> and <z>, each of which must be an integer or tilde and caret notation.In Bedrock Edition, it must be a three-dimensional coordinates composed of <x>, <y> and <z>, each of which must be a floating-point number or tilde and caret notation.Specifies the position of the block to be modified.
JE: <targets>: entityBE: target: target: CommandSelector<Actor>Must be a player name, a target selector or a UUID[Java Edition only]. Specifies one or more entities to modify.
JE: <slot>: item_slotBE: slotType: EntityEquipmentSlot: EquipmentSlot, slot.container and <slotId: int>: intSpecifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.In Bedrock Edition, slotId: int must be a 32-bit integer number. And it must be between -2147483648 and 2147483647 (inclusive).For blocks, must be container.<slot_number> (BE: slot.container <slotId: int>) where <slot_number> or <slotId: int> is replaced with a number specifying the slot.
*Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest’s top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
*A brewing stand’s bottom slots are numbered 0 to 2 from left to right, its top slot is 3 and the fuel slot is 4.
*A furnace’s slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.Other blocks which hold items but don’t have inventory GUIs (flower pots and jukeboxes) can only be changed with /data.For entities, must be one of the following, where slot number or slot id is replaced with a number specifying the slot:Inventory Slot Co-ordinatesSlotSlot NumbersRestrictionsarmor.chest(BE: slot.armor.chest <slotId: int>)any number[Bedrock Edition only]armor stands, mobs, and players only (though not all mobs will show or make use of the items)armor.feet(BE: slot.armor.feet <slotId: int>)any number[Bedrock Edition only]armor.head(BE: slot.armor.head <slotId: int>)any number[Bedrock Edition only]armor.legs(BE: slot.armor.legs <slotId: int>)any number[Bedrock Edition only]weapon.mainhand(BE: slot.weapon.mainhand <slotId: int>)any number[Bedrock Edition only]weapon.offhand(BE: slot.weapon.offhand <slotId: int>)any number[Bedrock Edition only]container.<slot_number>(BE: slot.container <slotId: int>)0–53players, item frames[Java Edition only] (slot 0), and minecarts onlyenderchest.<slot_number>(BE: slot.enderchest <slotId: int>)0–26players onlyhotbar.<slot_number>(BE: slot.hotbar <slotId: int>)0–8inventory.<slot_number>(BE: slot.inventory <slotId: int>)0–26horse.saddle(BE: slot.saddle <slotId: int>)any number[Bedrock Edition only]horses, donkeys, and mules only; <item> or itemName: Item must be a saddlehorse.chest[Java Edition only]donkeys, and mules only; <item> must be a chesthorse.armor(BE: slot.armor <slotId: int>)any number[Bedrock Edition only]horses and llamas only; <item> or itemName: Item must be a type of horse armor (if a horse) or a carpet (if a llama)horse.<slot_number>(BE: slot.chest <slotId: int>)0–14donkeys and mules with chests onlyvillager.<slot_number>(BE: slot.inventory <slotId: int>)0–7villagers onlySee More Results
JE: <item>: item_stackBE: itemName: Item: CommandItemSpecifies the item to be placed in the block or entity’s inventory slot.Inventory Slot Plugin Minecraft
JE: <count>: integerBE: amount: int: intMust be a 32-bit integer number. In Java Edition, it must be between -2147483648 and 2147483647 (inclusive). And it must be between 1 and 64 (inclusive).Specifies the number of items to be placed in the block or entity’s inventory slot.
BE: data: int: intMust be a 32-bit integer number. It must be between -2147483648 and 2147483647 (inclusive).Specifies the item data for the item(s) to be placed in the block or entity’s inventory slot. Values which are invalid for the specified item id will default to 0. If not specified, defaults to 0.
BE: components: json: Json::ValueMust be a JSON Object.Specifies the item components. Like data tags but supports only minecraft:can_place_on, minecraft:can_destroy, minecraft:item_lock, and minecraft:keep_on_death functions (see Commands/give#Examples)
BE: oldItemHandling: ReplaceModeMust be one of:destroy - Directly replaces items ignoring the original items in the specified slot.keep - Does not replace items if an item occupies that slot.Result[edit]CommandTriggerJava EditionBedrock Editionanythe arguments are not specified correctly Unparseable Failed<count> exceeds the stack limit of the specified item Failed Successful/replaceitem block ...if the specified block is not a container Failedif the specified block does not have the specified slot/replaceitem entity ...if <targets> or target: target fails to resolve to one or more entities (named players must be online)if none of the targets have the specified slot (for example, zombies don’t have horse.armor)if specified item cannot be place into the specified slot of any targeted entity(for example, place a stone into armor.chest of a player)/replaceitem ... keepif an item occupies the specified slot in keep mode N/AanyOn successReplaces the items in the specified slot with the specified items (previous items in that slot are lost).Output[edit]CommandEditionSituationSuccess Count/execute store success .../execute store result ...anyJava EditionOn fail000/replaceitem block ...On success111/replaceitem entity ...On success11the number of entities whose items are successfully replacedanyBedrock EditionOn fail0N/AN/A/replaceitem block ...On success1N/AN/A/replaceitem entity ...On successthe number of entities whose items are successfully replacedN/AN/AExamples[edit]
*To replace the items in the bottom-right slot of a single chest two block above with four spruce saplings:
*replaceitem block ~ ~2 ~ container.26 minecraft:spruce_sapling 4[Java Edition only]
*replaceitem block ~ ~2 ~ slot.container 26 sapling 4 1[Bedrock Edition only]
*To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
*replaceitem entity @p hotbar.8 minecraft:spruce_sapling 4[Java Edition only]
*replaceitem entity @p slot.hotbar 8 sapling 4 1[Bedrock Edition only]History[edit]Java Edition1.814w26aAdded /replaceitem.1.1418w43a/replaceitem can now be used on item frames.Upcoming Java Edition1.1720w46aRemoved /replaceitem. Replaced with /item replace.Pocket Edition1.0.5alpha 1.0.5.0Added /replaceitem.1.1.0alpha 1.1.0.0CanPlaceOn and CanDestroy functions are now supported for /replaceitem.Bedrock Edition1.16.0beta 1.16.0.55 Added new overload for /replaceitem with an option for destroy or keep.See also[edit]
*/blockdata — can also replace items in a container
*/entitydata — can also replace items in a mob’s inventory, or modify the drop chances of armor and weapons
*/give — give items to players without specifying specific inventory slots or overwriting other items Retrieved from ’https://minecraft.gamepedia.com/Commands/replaceitem?oldid=1781451’
Register here: http://gg.gg/oydjj
https://diarynote.indered.space
コメント