Minecraft:Commands/clearslot: Difference between revisions
From SAS Gaming Wiki
More actions
Fix template calls: add MC/ prefix |
Sync: updated from Minecraft |
||
| Line 1: | Line 1: | ||
{{Outdated feature}} | {{Outdated feature}} | ||
{{ | {{exclusive|bedrock}} | ||
{{Infobox command | {{Infobox command | ||
| name = clearslot | | name = clearslot | ||
| oplevel = | | oplevel = 1 | ||
| others = [[Minecraft:Cheat]] only | |||
}} | }} | ||
Clears a specified slot of a specified entity. | Clears a specified slot of a specified entity or container. This includes any containers listed in [[Minecraft:Chest (disambiguation)]]. | ||
==Syntax== | ==Syntax== | ||
{{ | Clears a slot from a container | ||
<code>/clearslot block <position: x y z> slot.container <slotId: int> </code> | |||
Clears a slot of an entity | |||
<code>/clearslot entity <target: target> <slotType: EntityEquipmentSlot> <slotId></code> | |||
==Arguments== | |||
{{Argument|position: x y z|CommandPosition}} | |||
: The coorindates of the container | |||
: {{arg desc|be=CommandPosition}} | |||
{{Argument|target: target|CommandSelector<Actor>}} | |||
: The entity to be targeted | |||
: {{arg desc|amount=multiple|type=entities|be=actor}} | |||
{{Argument|slotType: EntityEquipmentSlot|Enum}} | |||
: The slot type of the slot. This can be the following: | |||
* <code>slot.armor</code> | |||
** Armor slot for mobs with only 1 armor slot such as [[Minecraft:Horse]] | |||
* <code>slot.armor.chest</code> | |||
** [[Minecraft:Chestplate]] slot | |||
* <code>slot.armor.feet</code> | |||
** [[Minecraft:Boots]] slot | |||
* <code>slot.armor.head</code> | |||
** [[Minecraft:Helmet]] slot | |||
* <code>slot.armor.legs</code> | |||
** [[Minecraft:Leggings]] slot | |||
* <code>slot.chest</code> | |||
** [[Minecraft:Chest]] slots where the chest is equipped on mobs such as [[Minecraft:Donkey]] | |||
* <code>slot.enderchest</code> | |||
** Slots of a player's [[Minecraft:Ender Chest]] | |||
* <code>slot.hotbar</code> | |||
** A player's [[Minecraft:hotbar]] slot | |||
* <code>slot.inventory</code> | |||
** A player's [[Minecraft:inventory]] slot | |||
* <code>slot.saddle</code> | |||
** [[Minecraft:Saddle]] slot for mobs such as [[Minecraft:Pig]] | |||
* <code>slot.weapon.mainhand</code> | |||
** The main hand slot of a mob | |||
** For players, this refers to the currently held item in the [[Minecraft:hotbar]] | |||
* <code>slot.weapon.offhand</code> | |||
** The off hand slot of a mob or player | |||
{{Argument|slotId: int|int}} | |||
: The slot ID of the specified slot type | |||
: {{arg desc|be=int}} | |||
==Result== | ==Result== | ||
{{ | {{Result table|onlybe=1}} | ||
{{Result table|The command is incomplete, or any argument is not specified correctly.||unparseable}} | |||
{{Result table|cmd=/clearslot block ...|<code>position: x y z</code> isn't pointing to a container.||fail}} | |||
{{Result table|cmd=/clearslot entity ...|<code>target: target</code> fails to target anything.}} | |||
{{Result table|<code>slotType: EntityEquipmentSlot</code> does not apply for the entity targeted.}} | |||
{{Result table|cmd=|<code>slotId: int</code> does not point to a valid slot.}} | |||
{{Result table|The slot specified does not contain any items.}} | |||
{{Result table|succeed}} | |||
{{Result table}} | |||
==Examples== | |||
* Clear the current main hand slot of the the player | |||
** <code>/clearslot entity @s slot.weapon.mainhand 0</code> | |||
* Clear the first slot of a container | |||
** <code>/clearslot 0 64 0 slot.container 0</code> | |||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|bedrock}} | ||
|{{HistoryLine||1.2.13|dev=release|Accidentally added developer commands to iOS, including {{ | |{{HistoryLine||1.2.13|dev=release|Accidentally added developer commands to iOS, including {{cmd|link=none|clearslot}}.}} | ||
|{{ | |{{HistoryLine||1.2.14|Removed all developer commands.}} | ||
}} | }} | ||
== Navigation == | == Navigation == | ||
{{ | {{Navbox commands}} | ||
Revision as of 11:03, 12 May 2026
Template:Outdated feature Template:Exclusive Template:Infobox command
Clears a specified slot of a specified entity or container. This includes any containers listed in Minecraft:Chest (disambiguation).
Syntax
Clears a slot from a container
/clearslot block <position: x y z> slot.container <slotId: int>
Clears a slot of an entity
/clearslot entity <target: target> <slotType: EntityEquipmentSlot> <slotId>
Arguments
- The coorindates of the container
- Template:Arg desc
- The entity to be targeted
- Template:Arg desc
- The slot type of the slot. This can be the following:
slot.armor- Armor slot for mobs with only 1 armor slot such as Minecraft:Horse
slot.armor.chest- Minecraft:Chestplate slot
slot.armor.feet- Minecraft:Boots slot
slot.armor.head- Minecraft:Helmet slot
slot.armor.legs- Minecraft:Leggings slot
slot.chest- Minecraft:Chest slots where the chest is equipped on mobs such as Minecraft:Donkey
slot.enderchest- Slots of a player's Minecraft:Ender Chest
slot.hotbar- A player's Minecraft:hotbar slot
slot.inventory- A player's Minecraft:inventory slot
slot.saddle- Minecraft:Saddle slot for mobs such as Minecraft:Pig
slot.weapon.mainhand- The main hand slot of a mob
- For players, this refers to the currently held item in the Minecraft:hotbar
slot.weapon.offhand- The off hand slot of a mob or player
- The slot ID of the specified slot type
- Template:Arg desc
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Examples
- Clear the current main hand slot of the the player
/clearslot entity @s slot.weapon.mainhand 0
- Clear the first slot of a container
/clearslot 0 64 0 slot.container 0