So you want to learn command blocks do you no not you I’m not talking to you I’m talking to you dear viewers so you want to learn about command blocks it is I dr. Brian logon 111 and hopefully I’m not biting off more than I can chew but I think I would like to start this tutorial series where I teach you everything you need to know about command blocks and minecraft I’ve thought about doing this in the past but in the past command blocks were just a bit too complicated but with the new 1.9 snapshots things become a little bit Easier and so I’m going to give this a shot and we’ll have a long series of videos where I try to teach all kinds of things about command block programming and some about programming in general but if we want to get started if you were trying to learn to write you would Probably not take a pad and paper and go out to a crowded bar on a Friday night that would not be an appropriate work environment and similarly this Minecraft world is probably not the appropriate environment for us to start learning command blocks because there’s all kinds of distractions got villagers running Around chickens trying to run up to me and at night some zombies are going to try to come and eat face and so let’s start things off by setting up an appropriate environment for doing command block programming you’ll need to be running one of the minecraft 1.9 Snapshots as you can see in the lower left I’m in minecraft 15 week 35 be it’s possible that future snapshots might change or invalidate some of the stuff that I’m teaching but hopefully not but in any case you could always be safe to follow along in a 15 week 35 B which Seems like it’s a pretty good and stable snapshot so follow these instructions single player create new world change the game bode creative and give the world the name I guess I’m going to call it learning then go to more world options turn generate structures off change world type to superflat then Click customize presets and scroll down to redstone ready use presets done allow cheats is on bones chest is off so we are done let’s go ahead and create that new world and this will create us a nice super flat redstone ready world but there’s still some other Things that we should do to set things up when that you a spawn in the world in Minecraft if I press f3 there’s a whole lot of information on the screen but if I happen to be looking at a block down at my feet one of the things the very Bottom left of all that text is looking at and the coordinates of the block I’m looking at I’m looking at negative 220 155 negative 557 and especially for the purposes of tutorials but also in general is to help keep myself organized I find that it’s easier it hit f3 to Toggle the coordinate screen again it’s easier if we start somewhere closer to 0-0 so the first thing is if you type slash or T it will open the chat that allows you to type and so you need to open the chat and type /t p space @p space 556 5 And so that’s going to teleport me or in your case you the player to a new location in the world in this case five point five fifty six point zero five point five and if I hit f3 and look down at my feet I’m now looking at block 555 Five and so that’s one thing I want to do another thing is the Sun is moving across the sky and eventually it’s going to turn nighttime and get dark and be hard to see so we are going to type a game rule do it daylight cycle and if You don’t want to type all that out or spell it you can type the beginning of a command and then hit tab and it will autocomplete some of the words false and that will basically cause the Sun to stop moving which is useful and then I’m Also going to type time set 500 just to put the Sun somewhere that it’s above the horizon so we don’t have kind of the pinky you around but still near enough to the horizon that when I am looking towards the east towards positive X I will see the Sun Because it will be kind of a useful reference point to remember which way I’m facing also to figure out which way I’m facing I am going to go back over here to where zero zero is once again I’m looking at the text at the bottom Left hand corner of the screen and I can see that I’m looking at 0 55 zero and so over here since I’m in creative mode I’m going to get stoned block and I am going to just make a little l-shaped wall such that 0 0 is here and then if I walk in This direction in the wall the x coordinate the coordinates on the looking at at the bottom-left of the text here is 0 55 0 our XYZ coordinates and so if I walk in this direction my X increases if I walk in this direction my Z increases and my y-coordinate is just How high I am that’ll change if I am looking at fox that are higher up in the world and so if I’m looking at this block it’s got 57 this block is 56 this block is 55 and so what that does is it just helps me stay in this area where All the coordinates of blocks that I’ll be dealing with are going to be small positive numbers here I just placed a block at 7 56 7 and here’s one at 11:56 5 and the small positive numbers will just be easier to read and type as we’re doing some basic commands one other Important piece of information for setting up our world is to deal with the contingency that if somehow mysteriously I were to die and I were to respawn I would no longer be in the same location I press f3 we’re back at the same coordinates that the world originally Spawned us in and I’d have to teleport myself back to 550 65 or somewhere in that neighborhood in order to get back to the things that I built which is kind of pain in the neck so let’s fix that you can type slash spawn point and that Will spent your that set your spawn point to wherever you’re currently standing which is useful but it could be the case that in the future maybe you’ll make this a multiplayer world and put this up on a server and other players could be spawning in and so we’d like to set Their spawn points as well and so you can also say set world spawn and that will set the world spawn point to ever your standing and that’ll be the location that other players will spawn in as well so you should run both those commands after you’ve gotten yourself Into the location where you’re going to build and I suggest where there’s small positive numbers just over here where X and Z are both small numbers even with the daylight cycle turned off so that the Sun isn’t moving if you spend enough time in a world something else is likely To happen which is you will get whether this biome of the redstone ready world happens to be a desert which means we’re not actually going to see rain but the sky will turn dark and mobs will spawn so there’s a couple things we want to do to not have to deal with that Distraction as well for one we will type weather clear nine nine nine nine nine nine which will turn things back to clear weather for a long period of time so we don’t have to worry about that happening again and the other thing we will do is we will type difficulty zero To set things to peaceful alternatively one could go into the game options and change the game difficulty to peaceful there but since we’re learning command blocks it’s useful to learn the commands difficulty zero is peaceful difficulty one is easy difficulty two is medium and difficulty three is hard but we want Difficulty zero so as a result hostile mobs aren’t going to spawn and we shouldn’t see any bad weather for a long time now our world is kind of prepared for us to actually get some work done there are two other bits related to coordinates that it will be important to Know one is coordinate auto completion and the other is absolute versus relative coordinates and so to learn about those let’s start by using the setblock command if I wanted a particular block to be somewhere in the world here at location 356 for obviously I could grab a block out of the creative Mode inventory and just place it there but can also do the same thing with the setblock command so once again I’m looking at 3:56 for I could say set black 356 for stone and the block that I’m looking at 356 4 gets changed to Stone and if I want to change it back to wool I could do set black 356 for wool and do that note that if hit T to open up the chat and then press the up arrow you can easily go back and reference with the up and down arrows previous Commands that you’ve already typed in order to save typing time but another important way to save typing time is to use the autocomplete features on the command line so if I type s ETB and then hit tab it will autocomplete that word and furthermore if I’m currently looking At a block and some coordinates are expected right here I can hit tab to get 3 hit the spacebar hit tab again to get 56 hit the spacebar hit tab again to get 4 hit the spacebar and now say stone to convert it back to stone so in general Anytime you need to put in some coordinates if you hit tab to autocomplete those coordinates it will give you the coordinates of the block that you’re currently looking at so far all the coordinates that we have used have been absolute coordinates now I want to show off relative coordinates And so let me put a few blocks down here I’m looking at 3:56 for this one back here is 456 4 and this one back here is 556 4 if you look on the screen I’m going to try to show it with the mouse by hitting escape but it says facing East and then it’s kind of behind the word achievements here towards positive x but basically in this direction x increases and in this direction towards positive z facing south z will increase and so right now I’m looking in the positive x direction and so another way That I could change this block is to use relative coordinates rather than absolute coordinates relative coordinates always start with tilde that little squiggle thing and if I were to say set black tilde one space tilde space tilde stone what that’s going to do is take my current location my current location in the World and one block in the positive x-direction and I’m eight maybe you should write it out like this 0 blocks difference in the y-direction and 0 blocks difference in the Z Direction sy to block the stone and so it’s going to change the block that is One step away from me in the X direction if I did the same thing again but said tilde 3 tilde 0 tilde 0 stone it’s going to change that one over there the one that’s three steps away and similarly if I did something in the Z direction Rather than the X direction I could set a block three steps over in that direction to a stone block as well and as a shorthand you don’t have to say tilde 0 you can simply say tilde to mean the same thing as tilde 0 which means the same as my current coordinates and So set block same as my current x coordinate same as my current y coordinate but plus 3 in the Z coordinate set it to wool and this block over here changes to wool so there are times where we will want to use absolute coordinates by typing in 3:56 for and Will be other times where you want to use relative coordinates relative to the player or eventually relative to some command block that’s running a command this is supposed to be a tutorial series about command blocks but we’re ten minutes in and we haven’t even used a Command block yet so let’s try to fix that if you go on the creative inventory and you go looking around for command blocks you may be surprised that you’re not going to find them you’d even go through the search and try to look for things that have command block in them But it’s not there in order to get a command block you have to actually run a command which kind of makes sense the easiest one is give space @p space command underscore block and that will give you a command block it will give you an impulse command block by default I can sit down just like any other block in creative mode if I happen to lose track of these items if I happen to not have any command blocks on my bar any more rather than having to type the give command again to get another one if there’s already command block in the World and when you’re programming command box there will always be lots of command blocks around you there’s another way to get a hold of one if you didn’t already know in creative mode if you are looking at a block and you press the middle mouse button it will fill Your inventory with the block that you’re currently looking at so I just picked up a piece of stone there if I look at the ground and middle-click I can get a piece of sandstone and if I walk over and look at this command block and middle-click I can get a command Block and so that’s great that’s a very useful bit of functionality for when you’re trying to get a kind of copy of a block that’s already in the world it’s useful for building and especially useful for command blocks one thing that you’ll notice however if I right-click On the command block and I type in a command say hi if I were to then pick up this command block just by middle clicking and place it down again I get a copy of the block but I don’t get a copy of the commands or any of the other Settings that are inside that command block now there is a way to do that and that is to hold down control when you do middle-click which picks a block not only gives you the type of block that it is but also the data associated with That block and so if I place this one down this one says say hi rather than this one which was just an empty block so once again middle-click just gives you a block where as control middle-click gives you a block and any of the extra metadata associated with that block it’s A long road to learning to program command blocks in the next episode we’ll start talking about the differences between impulse chain and repeating command blocks but I think this is a good place to finish up our first episode in the series so I hope that you Guys enjoyed it and are having a great day I encourage your feedback and the and I will see you again soon bye bye but wait there’s more you can skip this part if you want to one of the challenges of doing this type of tutorial series that I find that’s kind Of common to any tutorial is figuring out where is kind of the baseline of where people are going to be coming from and what to learn and so for example I spend a bit of time just kind of like talking about the f3 screen and where to Find the coordinates of the block that you’re looking at maybe I should just assume that people know that or maybe people don’t know that and that’s a good thing to go over in any case I’m making a bunch of assumptions at the beginning of the video I talked about using Minecraft snapshot 15-week 34b or whatever it was and yeah I’m kind of assuming that people know how to get minecraft that they’re using minecraft on the PC and not on the Xbox or the Windows 10 Edition and they know how to gain access to the snapshots and things Like that it’s very difficult to figure out exactly where to draw the line in order to be catering to the vast majority of your audience and so I’m trying to do the right thing but I might get that line wrong and so I apologies if I do you can always kind of skip Forward ahead in the video or watch it at a fast speed if things are moving too slow for you I’m swinging this thing around as I talk because I need to gesture as I talk the other thing that I find really challenging with teaching programming in general is that with Programming it’s very hard to teach anything to someone until they already know everything and then you can actually teach stuff and so I’m going to try to use a process that I call iterative deepening which is we take a very shallow coverage of a few things And then in time we’ll come back and revisit them and go a little bit deeper but in the process of doing so you have to do a lot of hand waving or just tell people to trust me just do this thing and you don’t have to worry about what It means I told people what buttons to press on the Minecraft screen great this redstone ready world and I told them exactly what to type in order to teleport to this location to get things started without explaining the teleport command in much detail and so there’s lots of examples of things like that Where just to facilitate to beginner learning you need to hand wave and occasionally tell little lies and so at the end of these videos I think I’m going to try to clear up any of the lives that I’ve told or hand-waving or lives of a mission that I’ve done and so at the end of each video I’m going to have a little extra segment where I talk about those things and let’s do that for the first video right now near the beginning of the video to teleport here I said TP @ p 556 V to get myself teleported over here and I know someone’s going to say Brian why did you bother including the @p you could just say TP 556 five yeah you could there’s kind of like a shorthand for teleporting just the current player but that shorthand it Doesn’t even appear on the help menu for the teleport command and in general every other teleport you’re going to do is going to need a target player and so I prefer to always have the target player information in the teleport command when I was talking about middle-click versus control middle click On command blocks I gave the impression that a simple middle click would always give you an empty impulse command block whereas control middle click would give you a command block that keeps all the options that were here in the GUI and that’s not actually the case it’s actually far more complicated if you Middle click it will keep the type or the color of command block and so for example if I middle click on this repeating command block I’ll get another repeating command block but I’ll lose the command that used to be inside of it the way that things actually work are Any middle click will give you the same type of command block over here if you control middle click you’ll also get the command the previous output the tracking output and whether or not the thing needs redstone and regardless of whether you control middle click or just middle click you’ll never get the conditional Carried over and you always start out with an unconditional block and the reason for that is there’s actually three different places that minecraft stores information about the blocks one is the block ID your block name in this case impulse command block versus repeating command block or a chain Commandblock for the green ones which all have different block IDs and whenever you click a block you always get a block with the same ID then there’s also some associated data associated with the block that is just four bits a number from 0 to 15 in the Case of something like wool it controls the color of wool whether it’s white wool or orange wool or magenta Bowl all the way up to number 15 as black wool that’s why there’s 16 colors of wool for something like Pistons it controls the direction the piston is facing that Little number tells whether it’s facing to you know the west or the south or up into the air and in the taste of command blocks it controls both the direction that the arrow is facing as well as the conditionality and that information does not come with you when you middle click A block and then try to place it somewhere else because you can place it in a new facing direction and it always just defaults to unconditional and finally the other type of block other than the other type of information other than the block ID and that little bit of Data those four bits of data that control things like color or facing Direction there’s finally something called NBT data or block data associated with a block and so if I look at this block and check out its block data the data tagged not change autozero be custom named at powered 0b commands say Blah blah blah etc etc that we just saw up on the screen here that is NBT block data and when you control middle-click a command block it does try to carry a lot of that block data over when you replace it and so for example I could give this command block a custom Name by saying black data custom name foo and if I take a look at the black data on this block again we will see down here it says custom name foo and that even means that if I were to activate this block in the chat it says Not that a block says high but that foo tie right down here and if I control click that and drop it over here then the custom name is going to travel along with that as well most of the NBT metadata that you can see from the block Data travels when you control pick a block although for example it’s XYZ has been updated to its new XYZ location as compared to this one’s XYZ location so there’s actually a whole lot of subtleties associated with middle 2.click versus control middle click in terms of what information is carried Over and it actually differs per type of block because when I just middle click an orange wool I get orange wool it carries the block four bits of data whereas if I middle click a piston it doesn’t keep the facing direction at just the next time I place it down gets A different direction so there’s actually a whole lot of subtlety going on with middle-click versus control middle-click so be careful as you’re trying to copy different command blocks and move them around so hopefully those explanations clear up some of the lies of emissions or little white lies that I Told during this episode I probably told some others and managed to notice them while I was recording in general anytime you try to teach a complex topic it’s always hard to describe things at the appropriate level of detail without without telling lies and so my plan is To just have these little segments at the end of the episode where I clear things up in more detail too much detail for trying to just teach the point but good clarification detail for questions I know people will probably ask afterwards and so give me some feedback On the segment as well now I will really sign off and say goodbye I hope that you guys are having a great day Video Information
This video, titled ‘Learning Minecraft Command Block Programming, Part 1 – Setup’, was uploaded by lorgon111 – Brian’s Gaming Videos! on 2015-08-27 19:30:00. It has garnered 224610 views and 3842 likes. The duration of the video is 00:24:03 or 1443 seconds.
I’ll teach you Minecraft command block programming! This series will help you learn step-by-step using the 1.9 snapshots of Minecraft for PC.
This episode covers – creating an appropriate world environment for command block programming – the basics of absolute versus relative coordinates – a few basic commands (/spawnpoint, /setworldspawn, /setblock) – a few important buttons/controls – obtaining your first command block
Teaching programming to a wide audience is a challenge. I’ll try to go at a slow, detailed pace that most viewers can follow. If you know a topic well, you might want to watch at 1.5x or 2x speed to skim.
Teaching complicated subject matter is a challenge. During an episode, I sometimes do ‘handwaving’, or tell white lies or lies of omission, for simplicity to teach beginners. At the end of each epsiode, I’ll have a segment where I try to clear up the lies I know I told, going into more gory detail.
Subscribe for more videos & tutorials here: https://www.youtube.com/user/lorgon111
This playlist: https://www.youtube.com/playlist?list=PLHYAYMSbpcvulT34yXXN6SjTgpi0bOgka
Follow me on twitter @lorgon111 : https://twitter.com/lorgon111