Hey guys welcome back to another video on the basics of commands in Minecraft today we’re gonna be looking at the execute command which is the frustration of many minecraft players so if you are in that camp don’t worry after this video you’ll feel a lot better about this command and you’ll actually Understand how to use it to execute things so let’s go ahead and start executing things right away alright everyone so here we go let’s jump in with the execute command now before we start using the command I want to jump in with an explanation of how This command is meant to be used now there’s a lot of confusion out there not necessarily about how to use this command but when you should use it so let me explain it really simply pretty much this command is meant to execute or to run another command now you might be Thinking why in the world would you need a command to run another command that doesn’t make any sense why not just run the command that you want to run well the answer is sometimes you want to run a command at a particular place at a particular time And for a particular person or entity let me get rid of that so pretty much what this command is most useful for is running commands on like a server or an adventure map when you want things to happen at a particular time when certain conditions are met so for example say You want to make everybody who’s on your server with a certain class have a speed boost well you can use the execute command to do just that so let’s go ahead and start with a basic usage of the command and then we can jump in with some more advanced stuff so let’s go Ahead and type it out and take a look at it so it’s got a lot of different options here but we don’t need to worry about them right now let’s just do the most basic usage which is execute and then we need to say at which entity we Want to use the execute so let’s just keep it simple and do it at the nearest player which is ourself and then tell it where we want to execute the command and in relative position to our target entity now a more simplified way of saying that is we’re gonna run another Command and this is where we want it to run from so let’s go ahead and just run it from my exact position which is represented right here with the relative positioning of these tilde notation marks now if you don’t understand tilde notation go ahead and check out the Video I did on teleportation and the TP command and you’ll learn a lot more about it there okay so now that we have this typed out we need to say which command we want to execute so let’s go ahead and just keep it really simple and Do a say command and just say hello okay so we click enter and it runs that command now here is what I was talking about with all the confusion that’s out there about this command you’re probably saying why did you just not right out the say command because we could we Technically just say hello and not have to use the execute command and as you can see right here we get the exact same result well this is the answer the reason why you may or may not need the execute command itself is based upon when where and how you want your say Command to run now to make it a little bit easier to understand let’s get rid of the say example and let’s do something a little more complicated so let’s summon a zombie exactly where I’m standing so we’re going to execute right here a summon command at the nearest Player and we’re gonna execute it relative to that players position using these tilde notations which means exactly where I’m standing okay so as you can see we’ve now summoned a zombie exactly where I’m standing with the execute command now you might be saying the same thing why not just use the Summon command because technically if you just typed out summon zombie and then use the relative positioning coordinates you would get the same result well this is where we can see how it works instead of using the nearest player let’s go ahead and use an entity with Type equal to villager and a radius of ten and let’s go ahead and throw this in there just so it only does it on the closest one if we try and run that you’ll see that nothing happens because there are no entities with all of that data nearby so you can see there’s Villagers up here on the top level but they’re not within 10 blocks radius so let’s sum one one here and run the exact same command and now you’ll see that we’ve used the execute command to summon a zombie exactly on the position of this villager already guys so now you may be Wondering when you would ever use this command since we haven’t done anything really cool with it yet so here’s a advanced example that we can take a look at so if you look over there in the distance you’ll see that there’s a villager now if I walk near him you’ll Notice that something changes I now have a speed boost just from being nearby to this villager so if I walk away the speed boost is gone if I walk back near this villager it’s now activated so here’s how it works inside of this command block we have an Execute command that’s running a command which is the effect command at all villagers okay so pretty much what’s happening is the execute command is running this command over and over and over because it’s inside a repeating command block and where it is running it is on top of all of the villagers at Their exact location now what gives me the effect is the actual effect command so if you look at that command you’ll see that it’s targeting the nearest player within a radius of four blocks so the radius of where this is coming from is the position of the villager now I Know this is sounding confusing it’s a lot to think about because you’re talking about not only where you want to run the chem but to whom you want to run the command on or to what you want to do if you’re using a command that doesn’t have to run On a player or an entity so anyways here’s an advanced way that you can use this and I’ll show you guys a couple more examples to try and make it clearer as it goes on so in this next example we’re gonna look at how we can use the particle command with the execute Command so if we turn this on you’ll see I have tons and tons and tons of flames flying out of where I’m at so I’ll meet you switch the view here there you go I’m on fire alright so the way this is working is all with the execute command So let’s turn this off so we can see and talk about it so we’re executing just like we have been at the nearest player and relative to that player’s position and then we’re running a different command so last time we did the effect command and this time we’re going to be Doing the particle command so I’m not going to explain this command right now because I’m gonna do that in a later video probably actually the next video I’ll probably do the particle command and then do the effect command since we looked at those today and we haven’t actually learned how to use those Together yet so anyways pretty much what I’m doing is I’m running the particle command on top of myself over and over and over with the xeu command so if I turn it on it runs and turn it off it stops now just to show you guys how you can do this a Little differently is instead of executing this at myself we can go ahead and target those villagers one more time and when you do it a second time the villagers are now shooting out all of the flame particles which looks pretty hilarious anyways like I said the xeu command can Be pretty confusing and one of the reasons it can be is because stuff like this happens when people use the command so anyways let’s check out another advanced usage so here’s another way you can use the execute command to do something advanced if I go near this NPC He will automatically teleport me into the jail and as you can imagine you can use this for all sorts of venture maps or even multiplayer servers and actually in a previous video I did I believe it was one in this series on the se command and the OP command and a few Other multiplayer ones I gave in a spoiler of an advanced feature that I’m going to be doing in a little bit on NPC police officers so if you haven’t checked it out go ahead and take a look at that sometime because it’s way more advanced to what I’m about to show you But anyways here’s an extremely basic version of NPC police so if I go near this police officer he’ll automatically arrest me and I’m now in the jail so this is how it works we’re doing the execute command and we’re using it to execute a TP command Now we’re running the TP command at all of the villagers at their exact location with this repeating command block over and over just like we were in the previous examples and this time we’re using the TP command the teleport the nearest player within a one block radius To the villager into the jail cell which is represented here by these XY and z coordinates so if I go near another villager every time I’m within one block I will be arrested so that’s how you can use a very simple execute and TP command to make a sort of functioning NPC police Officer in your Minecraft world okay guys this is the last example I have for you guys and it is a very complicated one so don’t feel discouraged if you get really confused looking at this pretty much I’m just going to give you a preview now if you are at all interested In this feature with the execute command go ahead and check out the video I did in my command help series where I actually explain how to build this and how it works so pretty much what it is is it’s a feature for PvP servers that When you die you turn into a ghost for ten seconds then respawn back at whatever the PvP spawn point is on the like the arena or whatever it’s used for so anyways I just want to show you guys if you look in here we have the execute command and it’s pretty much All over the place because it’s an extremely powerful command that allows you to do things just like this so here we go let me go into survival mode so you guys can see how it work if I was on a PvP server and then imagine that I got Killed by another player and here it is in action so I’m a ghost now for ten seconds I have free reign to spectate the pvp fight and then once it goes to zero seconds I’m now back at the spawn point that’s it guys thanks for watching And if you made it all the way to the end of this video congratulations to you for being so zealous to learn how to use the execute command because it is a really heavy command to think about and it’s extremely discouraging for a lot of people because it’s so confusing not Just how to use it but when and once you get into using all the different variations of it it’s just technically a limitless command and therefore a limitless realm of confusion so anyways congrats to you guys thanks so much for watching my videos I really appreciate it and because you guys Staged at the very end I have something special just for you if you want to download either this house right here or this house right here to use in a structure block I’ve included them in the description below in this video so if you go down there click the download Link you’ll get the file that you need to put it in a structure block and then bring it into your actual world now these are the two houses that I did on my bill tutorial series so you can go over there and check that out if you’re Interested in learning how to build in addition to commands and if you’re just interested in commands I’ve also put down in the description below the command blocks that are required for that respawn PvP timer so in other words you guys don’t have to try and follow Along in the video that I made earlier on how to build it you can go ahead and just download those command blocks use a structure block to paste them in and then activate them and you’ll then have that PvP functionality on your own minecraft world or server so thanks so Much guys I’ll see you guys in the next video well we’re going to tone it down a little bit and go back to some more basic stuff and check out those particle commands and the effect commands Video Information
This video, titled ‘How to Use Commands in Minecraft: An Explanation of /execute with Examples! | 1.12.1’, was uploaded by Code_Zealot – Java Edition on 2017-09-07 03:09:32. It has garnered 119792 views and 2463 likes. The duration of the video is 00:13:28 or 808 seconds.
In this video I show you how to use the complicated and confusing /execute command in Minecraft 1.12.1! This command is virtually limitless in its application, which makes it one of the coolest, yet most difficult, commands in the game.
Ghost Re-spawn on Death Tutorial: https://www.youtube.com/watch?v=cTXfyWLI7F0
NPC Police Spoiler: https://www.youtube.com/watch?v=DVTOrEVmNvM
—
Downloads: Ghost Respawn Download: http://yoalizer.com/1WMr
Starter House Download #1: http://yoalizer.com/1WLt
Starter House Download #2: http://yoalizer.com/1WMM
—
Check out the other videos in this tutorial series on how to use commands in Minecraft to learn more!
Documentation for /execute: http://minecraft.gamepedia.com/Commands#execute
Code Zealot on Twitter: https://twitter.com/CodeZealotTuts
Code Zealot on Facebook: https://www.facebook.com/Code-Zealot-1836969809884269/