Hey guys what is up I am back with the spooky weird mic anyways so I’m still away but I thought that I would do just another kind of tutorial command store video which it feels like it’s been forever this is a new one to 1.14 so I Felt you know I might as well go over it even though I already use it a ton I don’t think everybody uses it so this is the data modify slash data the slash data command so it’s gonna go over the stuff in 1.13 as well as the stuff from 1.14 so we’re gonna go over all of them it’s not going to cover a hundred percent of everything about it and there’s a lot of little sneaky things you can do that are really cool but I will show you one little thing at the end but you can just explore and just Test and see what works and what doesn’t work cuz I spent countless hours just trying to get things to work sometimes it did sometimes it didn’t and it’s kind of fun to do that sometimes just to just waste a little time but you overall learn so it’s nice anyway so first off We are doing we’re gonna mess with data gets so data get is the first one data get let’s you see data it lets you see what’s associated with that thing so the data associated with an entity in that entity being myself is all this stuff so Players have a lot of data they have a lot of information they have what recipes they can craft they have death time they have all these good stuff and if you want to find or specify certain values from this you can use things such as let’s see what if we want to figure Out I guess we could do score that just comes up really easily or health health is just health so now if I do if I put a path this will leave me to the data that I want to find the answer from so if I put health it’ll tell me what my health Is right here which is 20 that is right here see health gives me an answer of 20 if I put selected item which doesn’t show up in this scroll bar but it is one that you can do I don’t know if it doesn’t show up it might show up somewhere it’s literally mind-numbing How much words there are but if we do selected item and this one will be important if you want to do other things later on selecteditem tells me what item selected let me put something now if I’m holding something it tells me my selected item is this Stuff so I can use this to kind of narrow down and help me kind of figure out what NBT I have to type to get an answer for selectors I have a tutorial on selectors that hopefully you’ve seen or maybe you know selectors by now if I Want to do I can do execute as at a NBT equals and this lets you choose and book for MBT so you would do selected item just like we did there and then the selected item that I’m looking for is one that has an ID of and I just copy What’s exactly above and I copied everything that was up there put all the proper commas and it says hi because it did find me if this was not true then it wouldn’t do anything just like it didn’t do anything right there it only said hi once okay yeah that’s a little bit more Than I wanted to go into on that know there’s data get block that a gift block is the same thing except it works on blocks so blocks have less data because they just most blocks don’t have any data let’s see data gap block and I can Use tab completion to get the block that I’m looking at then it’s not a block entity so it doesn’t have data but chess do you have data and the chest tells you what items are in the chest so there’s lime wall of a count of 64 in there Which is true so this is kind of useful if we can change it just saying gets it’s not really useful as you would do a scoreboard get it’s not useful scoreboard set is more useful and that’s what we’re gonna do here let’s stay with the start with the block one we’re going On to data merge so data merge let you put data somewhere so we’re going to put something on this block what data do we want to put on we want to put on and usually you need to start with these parentheses because the way you type it Here is like this so data merge and then lock like that so maybe you knew from before but if you want to lock a chest you have to do setblock chest lock just like that okay but let’s do let’s check out this chest does it have a lock on it No do I really maybe I don’t want to have to break the chest and put in a new chest maybe I just want it because it has like items in it that I don’t want to move well I can use data merge and I Can add this MBT that I want to add to it just like that and now it’s locked so you can do that too I don’t ever find myself using data merge block too often but it is a good one to know if you just On the run need to add a lock to a chest or something there’s other uses but then there’s data remove which I have pretty much never used now the way that you do it here is path not MBT when it says the word path you kind of like lists out Things so anywhere you see something that says like name : and then there’s quotation marks the path to that is just gonna be named but if you see name colon brackets with other stuff inside it ID quotation marks then the path is going to be named and then you come to these Curly brackets and you put a period and then you type the next thing inside that you want to go to so I D so that will be the path now if you see one that says this with square brackets and curly brackets well normally it’s gonna have Curly brackets and you would have like ID 1 comma and then you would have like other curly brackets sometimes sometimes you don’t what you need to do is to get the path is the name then you need square brackets yourself and a number between the square brackets to specify Which elements of 0 is the first element 1 is the second element and that’s just how the counting works and then dot ID so this will pick the first one’s ID which says ID – ok so that’s just an example of how it works we can use some Other stuff but this will let you remove stuff if you put a path so it will remove anything that is under the lock attack it will even remove the lock – so I removed that and now the chest is unlockable and if I do doubt I get blocked there’s nothing associated with lock There it’s all gone so let’s do so for example this might help you with some of the path testing let’s put acacia acacia sandstone if I do doubt I get block it says this that I get block this okay items you can see so we want two path to the sandstone not The acacia the sandstone so we need to make this path so sandstone is here right or yeah it’s here so we need to first go into items then we come across these brackets so we have to put brackets ourself and we have to make a choice which element do we want the First element the second element or the third element well we want the third element but you start at zero so the zeroth element the first element the second element so two is the element we want then if we hadn’t ER it’ll tell us all this MBT associated but maybe we Just want to figure out the count of the sandstone so then we just add dot and we add count and the dot lets us go inside the parentheses that’s sorry the curly braces and then we add the word count to specify which one in the curly braces we Want and it returns one because there’s only one in sandstone another thing you can do is instead of putting a two because this might be useful for dynamic system systems where everything’s changing you don’t know where the sandstone is and the players inventory maybe you’re checking if a player has Sands still in somewhere you don’t know where it is but you still want to get information so you can’t just put a number here because the array this is an array it gets bigger and smaller depending on what you do so what you need to do is you need to search it so You can put parenthesis to start searching so you can search for something that has an ID of minecraft : sandstone so this will search for an item in the array that has the same stuff that you put inside there and it’s still returned to count of 1/b and just To let me remove the word count so we get the whole message just see it found the MBT and took us to that location maybe i’m saying the wrong words for what it’s actually doing but that’s theoretically what it’s doing next you can do data merge on entities This might be more useful you have an entity that has data you just want to change it a little bit without resetting the whole thing so this armorstand has is visible but let’s make it invisible so we need to pick the armorstand type equals armas and that is nearest to This command block and only one of them keep in mind that data merge entity does not work with @e it’s gonna show up red you need to select only one and so you have to always use limit equals 1 @p data that the second thing is data merge Does not work with players at all you can’t change players data that’s another thing unable to modify for so that kind of sucks but there’s some workarounds and I’ve gone over them in previous videos on my execute over tutorial so you can check those out but I’m not kind Of covered messing with data into player anyway so entity invisible so this will make the armorstand add an invisible tag to the armorstand so we do that and it’s invisible and then this removes the invisible tag and now it’s gone ok cool let’s move on so the last one is data Modify this is the most useful and most complicated of them all so this one lets you make the chest have something specific that you want this one data modify is gonna let you put something from something else so I have data the chest has betta it’s gonna put my data In the chest data this is really cool because we can do some really cool stuff here so let’s see what this one I have typed up here does we are going to modify so it’s similar to merge what we’re modifying so we’re modifying the block at that position and we are going To pick the items at 0 so this is the first item in the chest we are going to set so your options here are append insert merge prepend set I just use set for when I want to change one thing from another thing so set from entity so this would be some You can do set from block but set from entity the nearest player and we are going to grab whatever there are holding whatever they’re selected item is so what this is doing is in the block it is making the 0th item the same as the selected item of the nearest player Right now the 0th item is chest but let me put 64 die right in my hand and when I click it put 64 Dyer right in there when I click it now nothing happens because I don’t have anything in my hand so it can’t set it so it just Comes up with an error so you can use this to I don’t really know off the top of my head what you would wanted to do with this but there’s multiple things that can do you can use with this data modify command in my most recent easy Shops video when you click the buy sign this it checks if you have this amount of cost and gives you the diamond if you have checks it gives you the reward if you have the price right so if I have 6 sandstone it will give me the diamond And you could move this anywhere and the way it worked with a lot of those kind of stuff so whatever the player was holding gets put inside a choker box and then it does some manipulation and counting and math and stuff to figure out you know whether you’re supposed to Be able to buy it or not so it uses that kind of take stuff from the selected item and put it in somewhere else kind of idea so there’s a lot of stuff you can do with that and this is i’m just laura brush lee briefly Going over the basics and there’s a lot of little things you can do if you know more like pre pen okay so i’ll go over these stuff really quickly without an example up end append means if you have a you put something after basically just like the word would suggest prepend Means you put something before merges merge and insert means you put it in at a certain location so those insert prepend a pen kind of have to do with the the erase right so if i want to prepend it would put it here if I let’s say I have some stuff Right I have a couple things that are invisible here prepend we’ll put it here right Teeter upend would put it right here and insert you can put it right here if you want so there’s just ways to manipulate a race but it’s kind of complicated and weird That’s why I prefer to stick to just set usually also something to keep in mind is another cool trick you can do is that we can just take off all that we can just say items but keep in mind we’re picking an array now so we are choosing To change the entire array of the command block so we need an array over here so inventory is that our array from the player so anything that the player has the block will have the chest will have so we’re gonna do this and then we’re gonna Do that and boom I have the same stuff but keep in mind with this it does truncate this row here this row gets deleted so just keep that in mind if you want to if you want to try using this to take the inventory and put it in the Chest you’re going to lose a row so better mine now coming up towards the end I know this is gonna be a long video now we’re going to mess with some a quick example of using it for entities so if I summon this entity it has a name that has Jason so As you know names in one point 13/14 need Jason formatting for the name so you can’t just put the word hi you have to say text hi and with Jason you can do selectors so you can do selectors but they don’t work in names of entities so I can’t just because I can use Jason it doesn’t mean all of the jason works so this Jason doesn’t work so it won’t actually say my name afterwards it will just say the word hiya P which is not what I want I wanted to say hi my name And so let’s see how we can do that so if we put a sign a sign that says hi my name the sign will work with Jason and it’ll say hi nearest player which is cloud wolf when I make this sign it’s not going to update constantly keep I Don’t you should know that by now but anyway so then I can summon this honest and that doesn’t proper we work but I can change that armorstands custom name to be the same as the text one which is the first line of this sign well let’s look at the sign To see what the sign says let’s look at the data we can use data get to figure out what data we want to copy from it so we have all this hubbub garbage but it looks like text 1 is the beginning of something we want so let’s write text 1 So if we write text 1 it returns something with a quote single quotation and a bunch of double quotations that have a bunch of weird kind of stuff but it kind of makes sense you don’t have to worry too much about all the junk but it Does say hi and it does say cloud wolf and it does also say have some special information like hover text and stuff who cares let’s throw it in and see what happens on the to the armor stand and the understand seems to be fine and here we go My name is now on the armor stand so you can use this process in a data pack which I have many tutorials on to do all three of these things in a row very quickly so one two three and if you do them in a data pack in a function file One two three they will happen before I can even see a difference so to me it looks like I just spawned a number stand with my name on it but in reality I did three things before it so that’s just how data packs work you can do things Without the player even seeing a difference anyways that was just a quick run-through of data get that emerge data modify that data remove so hopefully you guys found it useful there’s a lot of cool implications of being able to copy strings and stuff and manipulate data and hopefully you guys can find some Kind of cool use for this now one extra thing because I like to do this just a quick closer I like to throw in some challenges at the end so my challenge to you is going to be to use this data stuff so that when a player Dies their items get thrown into a chest so as soon as I die my items get thrown into a chest and I lose my items but you know since they’re in a chest now if I find my spawn point I can come back and get it and trust me I know this as Possible I’ve already done it I’ll show you an example real quick if you want to see this is in a game that I made in about two days I haven’t really done any streams playing the game I did some streams making it but I couldn’t because for some reason there’s some bugs with 1.14 and chunks are not updating for players but nevertheless the code does work so I’m gonna go into creative and I’m going to grab all this junk and and then I’m going to this is just giving you example of how it works improving that you can do it It doesn’t have to be perfect it’s okay it’s you can lose a line okay sorry I had to actually start the game for it to work so let me kill myself and as you can see a chest popped up there so if I come back to the spawn point you Probably already saw it but a chest pop down and if I open the chest boom it has my items in it and I lost all my items so as you can see it works sorry that was a bit long anyways guys other than that thanks for coming and hanging out And I’ll see you in the next one probably maybe you Video Information
This video, titled ‘Minecraft /data Command Tutorial’, was uploaded by Cloud Wolf on 2019-06-06 19:40:07. It has garnered 118926 views and 2503 likes. The duration of the video is 00:20:11 or 1211 seconds.
We cover the /data command and some of its many uses!
📝New Challenge: Medium ➡️ Put dead player’s items in a chest.
🙏 Subscribe??? Pls? 🔥 Lit Discord Server: https://discord.gg/HyZPCTu 💻 Website: https://dtdeadpool.wixsite.com/cloudgames 🐺 Twitter: https://twitter.com/cloudwolfbane 📧 Email: [email protected]
Music: Got copyright strikes sorry for long silence at the end but I don’t to wait to collect revenue or none because youtube has an issue with bots making false copyright claims. Youtube is literally the worst creator platform (when it comes to music)