This command block will allow you to set laser beams in a dispenser that will fire if the player passing through them has previously specified items. There will be three modes of operation: in the first case, the laser will make a kind of noise, in the second it will clean the player’s inventory, and in the third it will kill him.
How to use Laser Beams
- Copy the command text from a file (Ctrl+A -> Ctrl+C)
- Launch the game and get a command block, to do this type in console /give @p command_block
- Put the command block on the ground
- Click on it right click and paste the command in the “Command console” (Ctrl+V)
- Activate the command block using the button or the lever