This video will show you how to detect where a player is and make things happen when the condition is met hey my name’s happy if you find this video useful consider subscribing first of all i’m going to show you how you can detect players who are standing on a Specific block and as an example if we stand here we’re going to get jumped by invoker fangs and get killed by magic so it’s very simple all you’re going to have to do is type the following command execute at all players that’s at e if block Tilde tilde tilde go to the middle tilde type minus 1 and then the name of your block in this example it is yellow underscore terracotta then copy the command like so paste it into a repeating command block that is set to always active unconditional and repeat And press done and if you want to learn the basics of minecraft command blocks there’s a link in the top right of your screen to that video so our command block is detecting but nothing’s happening if we stand on the yellow terracotta it is detecting test passed But nothing happened so in this example we’re gonna make this dispenser launch fireworks now in order to do that we’re gonna want to break the block underneath it and we’re going to want to place an impulse command block one block below two blocks if you include the air gap Because that’s where we’re gonna be placing a redstone block using this block right here and the way we’re gonna do that is we are going to go and make the set block command first of all so place any block directly underneath the dispenser look at it and type the following set block Get your coordinates redstone block just like this then what you’re going to do is again copy the command don’t press enter press escape open up this command block do a space type run paste in your command remove the slash like that press done and then what you’re going to want to do is Before you stand on the block you’re going to want to open this command block and do this command set block tilde tilde tilde go to the middle tilde type 1 space air just like that now what we can do is cover up any air holes that we have and When we stand on this we should see some fireworks and that’s going to keep going until we step off the block now the one downside to this is that every single yellow terracotta block you stand on is going to activate this command so the simple fix is to create a new system Copy the command paste it into here it’s the same command or alternatively grab yourself a chain command block place it on top and set it to conditional and always active like that then all you’re going to want to do is go into this and you’re going to want to type in the Chain command block data merge block tilde tilde tilde go to the middle tilde type minus 1 and then do some squiggly brackets for the mbt data and type auto colon 0b and what that will do is it will make sure your system only activates once but i know what you’re thinking now my System will activate ever again so what you would do is if you had a reset system for your map or you had a trigger that you made that did something and let’s say you know you walked through the door and it was a pressure plate and It reset what you would do is you would have another command set up that would do exactly that so you’d have a command block and you would have the opposite of this except you wouldn’t have it set to minus one or one you would have the exact coordinates of the block and we’re Going to use the best trick to get those coordinates again set block set block is just a really good command if you need to get coordinates copy the coordinates paste it in here replacing the tildes change the auto to a one press enter grab yourself a button press that Firework and then this won’t activate again until we activate this so we activate it and it goes so that’s great you know but what if you want to use more terracotta in your world or more of a specific block uh you don’t really want it doing the fireworks all the time you could Just disable it and have it re-enable at certain points but that’s a little complicated you could just use this method what this method’s going to allow you to do is it’s going to allow you to detect a player at a certain point and an example of detecting the player’s Location can be seen when we walk into the blue door we join the blue team the doors close and we’ve also been assigned a tag and by running this command we can see that the tag is sbb which stands for sumo battle blue so for this one you’re Again going to want to have a repeating command block and a chain command block set them to the exact same settings inside conditional always active on the chain and set this one to always active unconditional inside as well so it should look something like this for the Chain command block we can have the exact same command as the other one data merge block minus one zero b and then this is where things get interesting we’re going to be using a very similar command to the advanced checkpoint system from the previous video last week So the first thing we’re going to do is grab our coordinates we’re going to place a block above where we want it to be and we’re going to do set block and we’re going to grab our coordinates best way to get your coordinates then all We’re going to do is just type a chat message then we’re going to go back to the start and we’re going to type our slash as if we’re doing a command now we’re going to run the command the command is going to be slash execute at all players square brackets x Equals and we’re going to take our first number which is going to be minus 45 we’re going to do a we’re going to do a comma and we’re going to do y equals and that’s going to be -5 and then we’re going to do another comma and we’re going to do z Equals and that’s going to be 10. then we’re going to do another comma we’re going to do distance we’re going to do equals 1 dot dot so that means you’re going to have to be right on top of this block for it to activate close your square Bracket and then we’re going to do this we’re going to do as at s run say hi and that’s just going to test if we’ve actually done it right so it’s gonna say hi why because we’ve done one dot dot dot dot one we should have done dot one so Now as you can see if i say hi it looks like this but this is not gonna activate unless we’re standing right here and if we were to put that into a repeating command block you can see it would do the same thing or not change this to an at s there’s Your fix we’re going to try that again or maybe i was wrong change this to execute as at a now will it work yes server command you actually want to do is execute as all players with the coordinates with a distance of dot one unless you want to have a range you Could have a range it goes in a circle with the range so if you were to have a range of six that would be a circle believe it or not circles in minecraft around this block but for the purpose of this example we’re gonna change it back to a one so Your command would be execute as all players in the coordinates with a distance of one or less as the player run command which in this case is going to be the same as before we’re gonna get our command block we’re gonna actually just copy it this time and that’s the command Set block one air and we’re gonna do this we’re gonna do set block coordinates redstone underscore block place it into here get rid of the slash and the previous command if you followed along with that part and because this is activated we’re going to have to reactivate this command And what we should see is a single file work and of course same with last time if you want to reset it just place a command block somewhere have it activate on its own um at a certain trigger point let’s say as you say you walk through a Door or you complete the sequence and you want it to reset for another player have a command data merge block get the coordinates of this block and do auto 1b that will reset it and then you can stand on your block again and it doesn’t even have to be yellow wall because We’ve done it as a coordinate we can just stand here and this will activate regardless of what block is here so despite the slight mistakes which we did address i hope you found this video somewhat useful if you did feel free to leave a like subscribe hit the bell as Well man has been happy and i’ll see you next time goodbye You Video Information
This video, titled ‘Detect A Player’s Location With Blocks In Minecraft Java Edition | 1.18+’, was uploaded by TheHappywheels1 on 2022-01-26 16:00:13. It has garnered 45903 views and 861 likes. The duration of the video is 00:08:02 or 482 seconds.
► Learn how to use Command Blocks to execute commands at a players location!
0:00 Intro 0:09 – Method 1 – Block Detection 3:47 – Method 2 – XYZ Detection 7:38 – Outro
━━━━━━━━━━━━━━━━━ ✅ SUBSCRIBE FOR MORE! ► https://bit.ly/2kGLfD8
💡 GOT A VIDEO IDEA? ► https://notionforms.io/forms/video-ideas-thehappywheels1
🔗 ALL THE LINKS! ► https://bio.link/Happy
😎 BECOME A MEMBER! ► https://www.youtube.com/TheHappywheels1/join
👕 MERCHANDISE! ► https://teespring.com/stores/thehappywheels1-merch
🌎 TheHappywheels1 is officially partnered with StickyPiston Hosting! ► Use code “HAPPY” for 20% off your ‘paid’ server (lifetime) https://stickypiston.co/TheHappywheels1
━━━━━━━━━━━━━━━━━ 🎵 MUSIC
🔹 Epidemic Sound: https://www.epidemicsound.com 🔹 Try Epidemic Sound FREE for 30 days: https://www.epidemicsound.com/referral/zowkhz/
🔹 NoCopyrightSounds – https://www.youtube.com/channel/UC_aEa8K-EOJ3D6gOs7HcyNg 🔹 YouTube Audio Library – https://www.youtube.com/audiolibrary/music
━━━━━━━━━━━━━━━━━ #Minecraft #Tutorial #CommandBlocks