Skip to main content
2 of 2
replaced https://minecraft.fandom.com/wiki/ with https://minecraft.wiki/w/

In bedrock / edu edition you are able to use the hasitem selector to select entites / players based on their items. However, it is a bit limited as it cannot select specifically named items, only types of items and their integer data (and at the time of writing that is also bugged).

So, for those things that you want to happen if they have it equipped / in their hand, you'll need to rely on using a different item instead of detecting its name.
Sidenote: For things like this I would recommend making an add-on, as it allows you to make your own custom items, but that is a lot more work and a lot more complicated than doing it ingame.

Here are two examples:

  1. detecting someone wearing an iron helmet:
@a[hasitem={item=iron_helmet,location=slot.armor.head}]
  1. detecting someone holding an amethyst shard in their offhand:
@a[hasitem={item=amethyst_shard,location=slot.weapon.offhand}]

Now with that you can either tag (/tag @a[...] add resistance) someone or even apply the desired effects immediately (/effect @a[...] night_vision).

Plagiatus
  • 2k
  • 8
  • 21