Skip to main content
Clarified section on repeats
Source Link
One 2 Many
  • 12.9k
  • 9
  • 52
  • 91

Up-to-date answer

As of 1.18.30, the beta containing these features has been released.

The latest releases of Minecraft: Bedrock Edition have added a new target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

Repeating any of item, count, data, location, andor slot can be repeated within the same section. The system will takenot cause an error, however, only the lastlatter one that is specified (furthest to the right) as prioritywill be considered.

Up-to-date answer

As of 1.18.30, the beta containing these features has been released.

The latest releases of Minecraft: Bedrock Edition have added a new target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

item, count, data, location, and slot can be repeated within the same section. The system will take the last one that is specified (furthest to the right) as priority

Up-to-date answer

As of 1.18.30, the beta containing these features has been released.

The latest releases of Minecraft: Bedrock Edition have added a new target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

Repeating any of item, count, data, location, or slot within the same section will not cause an error, however, only the latter one that is specified (furthest to the right) will be considered.

It is now released.
Source Link
One 2 Many
  • 12.9k
  • 9
  • 52
  • 91

BetaUp-to-date answer

This answer describes features that are present in the latest betaAs of 1.18.30, but the full releasebeta containing these features has not yet been released.

The latest betareleases of Minecraft: Bedrock Edition hashave added a new target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

item, count, data, location, and slot can be repeated within the same section. However,The system will take the behaviour of doing so has not been pinpointed.


Morelast one that is constantly being discovered aboutspecified hasitem=. This answer will be updated(furthest to the right) as new discoveries arise.priority

Beta answer

This answer describes features that are present in the latest beta, but the full release containing these features has not yet been released.

The latest beta of Minecraft: Bedrock Edition has added a target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

item, count, data, location, and slot can be repeated within the same section. However, the behaviour of doing so has not been pinpointed.


More is constantly being discovered about hasitem=. This answer will be updated as new discoveries arise.

Up-to-date answer

As of 1.18.30, the beta containing these features has been released.

The latest releases of Minecraft: Bedrock Edition have added a new target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

item, count, data, location, and slot can be repeated within the same section. The system will take the last one that is specified (furthest to the right) as priority

Source Link
One 2 Many
  • 12.9k
  • 9
  • 52
  • 91

Beta answer

This answer describes features that are present in the latest beta, but the full release containing these features has not yet been released.

The latest beta of Minecraft: Bedrock Edition has added a target selector argument, hasitem=.

Syntax is as follows:

One item:

@a[hasitem={ item=<…>, count=<…>, data=<…>, location=<…>, slot=<…> }]

Multiple items:

@a[hasitem=[ { item=<…>, ……… }, { item=<…>, ……… } ]]

Fields are:

  • item: Test for which item ID?
  • count: Test for a certain count of this item. Can be a number or range (5..10)
  • data: Test for the item's data value.
  • location and slot: Only consider the slots specified to look for the item. location specifies the slot category, slot specifies the slot number.

If multiple sections are specified within [ {}, {} ], all must pass.

item, count, data, location, and slot can be repeated within the same section. However, the behaviour of doing so has not been pinpointed.


More is constantly being discovered about hasitem=. This answer will be updated as new discoveries arise.