Command for magic items in Minecraft Education Edition

Command for magic items in Minecraft Education Edition - Crop fortune teller reading magic book at table with candles

I'm creating a game for my school on Minecraft Education Edition, which is Bedrock based. At a point in the game, the players will collect items I rename on an anvil that will give special abilities, e.g. a book that summons lightning, a book that replenishes health of nearby players, a book that makes the holder invulnerable, a helmet that allows night vision, and a few others I am working out.

How do I code command blocks to tag a player either wearing item or holding in off-hand and allow the tagged player to have the effect happen?






Pictures about "Command for magic items in Minecraft Education Edition"

Command for magic items in Minecraft Education Edition - Encyclopedia placed near wooden decorative hand shaped pen holder
Command for magic items in Minecraft Education Edition - Body part of unrecognizable scientist in white uniform writing down formula after providing chemical research with fluid in flask during science lesson in university
Command for magic items in Minecraft Education Edition - Measuring triangle ruler and pencils on table





Commands You Need to Know - Minecraft Education Edition




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Anete Lusina, Rachel Claire, RF._.studio, Skylar Kang