Skip to content

Instantly share code, notes, and snippets.

@Korko
Last active August 29, 2015 14:05
Show Gist options
  • Save Korko/d3d87e9edaa7d442c920 to your computer and use it in GitHub Desktop.
Save Korko/d3d87e9edaa7d442c920 to your computer and use it in GitHub Desktop.
[Minecraft][Command Blocks][1.8][BLOCKED] Mobs Lure # Specific Snowball that after a short delay will lure mobs
# CommandBlock order : West, East, Down, Up, North, South
# /give @p snowball 1 0 {display:{Name:"Lure"}}
# Only call once
/scoreboard objectives add LureDelay dummy
/scoreboard objectives add OnGround dummy
# Around a fast clock (20t/s)
# /fill ~ ~-1 ~ ~ ~-1 ~-1 redstone_block
# /fill ~ ~1 ~ ~ ~1 ~-1 stone
# Detect Snowball (BUG: Snowball doesn't keep it's CustomName, so ftm, all snowballs summon a Lure)
/scoreboard players set @e[type=Snowball] LureDelay 1
# Way around to detect if OnGround (or quite similar)
/scoreboard players set @e[type=Snowball,score_LureDelay_min=1] OnGround 2
# Detect block under (~-.5)
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~-.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~-.5 ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~-.5 ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~-.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~-.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~-.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~-.5 ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~-.5 ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~-.5 ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~-.5 ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
# Detect block over (~.5)
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~.5 ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~.5 ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~.5 ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~.5 ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~.5 ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~.5 ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~.5 ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
# Detect block at level (~)
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~ ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~ ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~ ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~-.5 ~ ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~ ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~ ~-.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~ ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~ ~ ~.5 air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
/execute @e[type=Snowball,score_OnGround_min=2] ~ ~ ~ detect ~.5 ~ ~ air 0 scoreboard players set @e[type=Snowball,r=0] OnGround 0
# Yay found OnGround!
/scoreboard players set @e[type=Snowball,score_OnGround_min=2] OnGround 1
# Summon VillagerGolem
/execute @e[type=Snowball,score_OnGround_min=1,score_OnGround=1] ~ ~ ~ summon VillagerGolem ~ ~ ~ {NoAI:1,Silent:1,Invulnerable:1,CustomName:"Lure",ActiveEffects:[{Id:14,Amplifier:0,Duration:410,ShowParticles:0b}]}
# Compute Golem age
/scoreboard players add @e[type=VillagerGolem] LureDelay 1 {CustomName:"Lure"}
# Before destroying the Golem, summon a creeper to explode mobs around
/execute @e[type=VillagerGolem,score_LureDelay_min=400] ~ ~ ~ summon Creeper ~ ~ ~ {Fuse:1b,ignited:1b,ExplosionRadius:5,powered:1}
# Kill the Golem
/tp @e[type=VillagerGolem,score_LureDelay_min=400] ~ -20 ~
/entitydata @e[type=VillagerGolem,score_LureDelay_min=400] {NoAI:0}
# Reset scores
/scoreboard players reset @e[type=Snowball,score_OnGround_min=1,score_OnGround=1] LureDelay
/scoreboard players reset @e[type=Snowball,score_OnGround_min=1,score_OnGround=1] OnGround
@Korko
Copy link
Author

Korko commented Aug 15, 2014

TODO: Change Snowball by Arrows so there's a way to detect if this arrow is coming from the correct bow (named)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment