Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/clearslot: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Outdated feature}}
{{Outdated feature}}
{{MC/Exclusive|bedrock}}
{{exclusive|bedrock}}
{{MC/Stub}}
{{Infobox command
{{Infobox command
| name = clearslot
| name = clearslot
| oplevel = 0
| 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==
{{MC/Empty Section}}
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: int></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==
{{MC/Empty Section}}
{{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 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
|{{MC/HistoryLine|bedrock}}
|{{HistoryLine|bedrock}}
|{{HistoryLine||1.2.13|dev=release|Accidentally added developer commands to iOS, including {{MC/Cmd|link=none|clearslot}}.}}
|{{HistoryLine||1.2.13|dev=release|Accidentally added developer commands to iOS, including {{cmd|link=none|clearslot}}.}}
|{{MC/HistoryLine||1.2.14|Removed all developer commands.}}
|{{HistoryLine||1.2.14|Removed all developer commands.}}
}}
}}


== Navigation ==
== Navigation ==
{{MC/Navbox commands}}
{{Navbox commands}}

Latest revision as of 11:08, 25 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: int>

Arguments

Template:Argument

The coorindates of the container
Template:Arg desc


Template:Argument

The entity to be targeted
Template:Arg desc


Template:Argument

The slot type of the slot. This can be the following:

Template:Argument

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 player
    • /clearslot entity @s slot.weapon.mainhand 0
  • Clear the first slot of a container
    • /clearslot 0 64 0 slot.container 0

History

Template:HistoryTable

Navigation

Template:Navbox commands