This command will allow you to get a laser gun, as well as other useful and interesting devices. So now your territory is completely protected by laser guns that react to the movements of enemy mobs and automatically shoot at the target.
How to use Laser Cannons
- 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