Minecraft Blogs / Tutorial

Working Security Lasers In MC - Command Tutorial

  • 6,128 views, 3 today
  • 6
  • 2
  • 15
CreeperLadMC's Avatar CreeperLadMC
Level 56 : Grandmaster Slime Tamer
52
Want a good security measure for guarding your precious items, or perhaps want a good trap mechanism for your map? Well, you've come to the right place. In a few easy steps, create your very own working security lasers in Minecraft!

Step 1) Get yourself a repeating command block, and type in

/entitydata @e[type=Bat,r=32] {NoAI:1}

Step 2) Create your security laser by spawning bats along where you want your laser to be.

Step 3) Inside another repeating command block, type in this command:

/execute @e[type=Bat,r=32] ~ ~ ~ particle reddust ~ ~ ~ 0 0 0 150 force @a

The bats you've just spawned should immediately start spawning red particles.

Step 4) Now, for the final touch: with the help of another repeating command block, type in

/execute @e[type=Bat,r=32] ~ ~ ~ kill @a[r=1]

Walking into the particle-emitting bats should now kill you immediately.

Step 5) Now, finally, give all bats within a 32 block radius the invisibility effect by typing in this command:

/effect @e[type=Bat,r=32] minecraft:invisibility 9999 1 true

Then, when you're done, make them invulnerable using this command (to prevent players from killing the bats)

/entitydata @e[type=Bat,r=32] {Invulnerable:1}

Tah-dah! You're done making your very own security laser system! You can also give the laser a more tripwire-like property by replacing the step 4 with this step:

1) Inside a repeating command block, type in

/execute @e[type=Bat,r=32] ~ ~ ~ testfor @a[r=1]

2) Now, place a comparator in front of the command block, right-click it, then place a repeater in front of it to strengthen its redstone signal.

3) Wire it up to whatever redstone contraption you wish to power! For instance, a security alarm (note blocks or a /playsound command block).

Think this tutorial was useful to you? If so, don't hesitate to leave a diamond (it really helps), and also consider subscribing for more upcoming material!

P.S. If you really DO use this contraption for your map or something, please consider giving credit to me for the security laser design...I mean, it took me quite a bit of time to come up with this :/
Tags

Create an account or sign in to comment.

1
07/30/2018 11:37 pm
Level 1 : New Miner
Xx_ShadowPlaysMC_xX
Xx_ShadowPlaysMC_xX's Avatar
WELP

1
07/30/2018 11:35 pm
Level 1 : New Miner
Xx_ShadowPlaysMC_xX
Xx_ShadowPlaysMC_xX's Avatar
welp the bats dont get the particles
1
08/31/2017 5:05 pm
Level 1 : New Miner
LapisWhovian
LapisWhovian's Avatar
So... how do I turn it off?
1
06/08/2017 6:15 pm
Level 8 : Apprentice Engineer
Theory of Everything
Theory of Everything's Avatar
As a addition to Flashteens' sugestions you can also add a tag (and is way better than custom names!)

/summon Bat ~ ~ ~ {NoAI:1} security:1b

Do the similar way as what the original Steps 2~5 do in this post, but modify all selectors @e[type=Bat,r=32] into @e[type=Bat,r=32,tag=security]
1
08/19/2016 11:29 am
Level 64 : High Grandmaster Technomancer
flashteens
flashteens's Avatar
Nice tutorial, but there's a small issue...

It seems that with this security system on, any players may be killed once they touch a bat.
But, the problem is that bats may be spawn naturally, too, even in Peaceful Mode!

I have 2 suggestions to solve this problem...

Solution #1: Run the command: /gamerule doMobSpawning false, and never let other players spawn bats nearby the security system. But, if you wish to let other mobs spawn naturally, this way might not fit you...


Solution #2: This way is a bit more complicated... Give your bats a specified name, and this method is thus slightly modified as below:

1) Directly type the following command in your chat box for several times as you move along the expected locations of the security laser:
/summon Bat ~ ~ ~ {NoAI:1,CustomName:"Security",Invulnerable:1}

2) Do the similar way as what the original Steps 2~5 do in this post, but modify all selectors @e[type=Bat,r=32] into @e[type=Bat,r=32,name=Security]

Try if any of them work! :D
1
08/19/2016 9:27 pm
Level 56 : Grandmaster Slime Tamer
CreeperLadMC
CreeperLadMC's Avatar
I had assumed that you would set doMobSpawning to false before attempting this build but thanks for reminding me anyway! :D
1
08/19/2016 10:40 am
Level 39 : Artisan Professor
FlowKo
FlowKo's Avatar
and 1 more thing the particles is not red they are colorfull http://imgur.com/a/ATw5t
1
08/19/2016 10:33 am
Level 39 : Artisan Professor
FlowKo
FlowKo's Avatar
you need to fix the first command : /entitydata @e[type=Bats,r=32] {NoAI:1} to bat not bats! and for the second one as well!
1
08/19/2016 11:16 am
Level 56 : Grandmaster Slime Tamer
CreeperLadMC
CreeperLadMC's Avatar
Careless mistake... sorry bout that :b
1
08/19/2016 11:26 am
Level 39 : Artisan Professor
FlowKo
FlowKo's Avatar
are u going to fix it ?? i mean the particls ??
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome