en 1.8 /execute Tutorials Welcome to my tutorial where I will teach you about the /execute command!

First, we will target a mob:
/execute @a   Targets all players.
/execute @e   Targets all entities, including item frames, armor stands and items.

To be more specific use:
/execute @e[type=TargetEntityHere]
Or if you want to target names mobs only then use:
/execute @e[type=TargetEntityHere,name=MobName]

Ok, now onto the actual command:

The ~ symbols show where the command will take place based on the location of the entity [XYZ]. For example, 
/execute @e[type=TargetEntityHere,name=MobName] ~0 ~1 ~0 CommandHere

So if you want to summon lightning at a pig named Bob, you would use:
/execute @e[type=Pig,name=Bob] ~0 ~0 ~0 summon LightningBolt

You can also use /execute commands in /execute commands!~
/execute @e[type=TargetEntityHere,name=MobName] ~ ~ ~ execute @e[type=TargetEntityHere,name=MobName] ~ ~ ~ kill @e[type=Player,name=Herobrine]

You could do awesome stuff with this, like give players particle trails and summon TNT to create bat bombers!

Hope you learned something!

The command

Note: Minify the command to avoid issues :)

Created: Thu, 18 Jun 2015 03:46:52, Updated: Mon, 29 Mar 2021 06:41:55, Views: 4845

Share on:  


Top entries from the_admin_boy

Top entries in Tutorials