So hey dirty plate welcome to the stream hello we’re gonna see if um how well the chat overlay is gonna work in this setup i may have to disable it if it’s distracting let me play with it a bit Hey gekko um yeah so what we’re doing today is um i released a little bit of a new api with our bedrock last week and so um what i’m gonna do is i’m gonna give you a chance to like ask me questions maybe i’ll do um some analysis or some programming here Um try to work you through um how to use our bedrock um this would be i think a good um tutorial for maybe people who are catching up with this later on um how to maybe use our bedrock something to um point people too so we’ll see how This works first time sort of trying this um sort of live outside of a classroom um let me turn the music down a bit for me Let me try it there yeah so anything um anyone wants to look at in particular um now is a good time to sort of start asking in the chat um and i’ll see what we can get up to So give a chance for some more people um to log in and ask questions before i start going over some of the changes that i’ve made with um the new api in our bedrock so yeah so our bedrock is still in development so the api is still Changing a lot as i come up with better ideas and how i want to sort of express things um one thing that i’ve done with this is i’ve tried to get rid of sort of the dollar sign interface as being um of being um in the um You know the dollar sign interface is being sort of used um so um crack magnet asks about um how much crine obsidian is in a um ruined portal yeah so that’s going to take um some code digging i’m probably not going to do much code digging on this stream Um but it’s something to sort of maybe ask in the code digging channel on my discord and see if we can look into it let’s do that all right i think i’ll get started um so if when you’re want to use um all right um So one of the um so the first thing when um when loading so our bedrock is currently in development that means that if you want to install it um and you’re using r you need to use devtools um so this is all covered in my our bedrock tutorial videos Um we’ll go over a little bit of it today in case anyone is coding along with me or um needs to update to match what i’m what i’m doing um so to do dev tools install github https um sorry doll github all right cartwright sorry read a cartwright slash our bedrock Our bedrock so dev tools install github read a cartridge our bedrock so that’s what you want to do in order to install our bedrock so now i’m going to do shift enter to execute control enter to execute it and um it’s now going to go out to github download the So down in here um it’s going to download the source code and it’s going to compile it and it’s going to install it so after that we can then load our bedrock into r and we can start um analyzing worlds so that’s done so now i’m gonna do library our bedrock and do Control enter again and that’s going to load it so we now have our bedrock So next i’m going to do a command called list worlds control enter and that’s going to give me a list of some of the worlds on my system And so some of these worlds are very small not useful you can kind of see some of the stuff i’ve been working on um and so the output of list worlds is a table or a tibble and um in our bedrock typical and like tidy burst kind of stuff um And it has three columns id the level name and the last opened so the id this is basically the folder name in your primary folder directory the level name and last open is stuff that is stored in the mbt for this world and they tell you like The name of the world that you saved it or when you last opened it um so i’d use this to figure out the id of the world that i want to open so let me come up here let’s do let’s also load tidy verse while i’m at it Again control enter loading tidy verse television gave us a lot of tools we want to use to work with this so we have list worlds um and so list world so like you know if you look closely at my list world output i have like 151 worlds locally in my local World directory um and so in our bedrock so i’m gonna do one thing i’m gonna come over here i’m gonna save the results of list worlds to a dat object then i’m going to cover here and i’m going to view it and it’s going to give me that same Table but in an easier way to look at it um so let’s look for let’s let’s go to uh one of one of my larger worlds um has a lot of stuff in it um I’ll work on tundra s p that’s that’s sort of a world that me and my kids play on um so i’m coming here i’m going to highlight the id and copy it and then i’m going to come back here and i’m going to i’m going to do Db path paste in that id and then i’m going to do ctrl enter to get that red i’m going to open db so db is going to be bedrock db db path so that’s going to now open up the database which is an object um so db is now an object That um holds sort of a handle to the database um in memory so you can access it so this is where our ap so some of this you’ve seen is all sort of common which is earlier but this is where part of the new api takes effect Used to be the rule was if you want to close the database when you’re done you do db close that still works but the recommended api now is close db so if you type closed db the database will be closed um when you’re done with it so that’s sort of one api change I’ll go back up here i’ll do ctrl enter again to reopen the database and now i’m going to get all the keys in the database and do that the command is now git keys so i can do get keys database and then do control enter that’s going to give me a list of All the keys in the game so let’s see if it’s going to let me open it it may not so we can do something like let’s say head keys to look at the first six or so keys let’s see we get a list of keys from the database so keys like this here Um with the ats at the beginning those are chunk keys so these are keys that point to chunk data and the way chunkies are structured so the at tells you it’s a chunky and our bedrock um key terminology um this is not how they’re saved in the Game they’re saved in a different format in the game that’s um hard for us to really parse and so i came out with this format to display them in a human friendly way and so this is your x coordinate of the chunk the z coordinate of your chunk This is your dimension so this one says this is another chunk and this 44 tells us the type data of this um and of this data set now 44 is uh version information um so jerry jerryplay says too much information yes there’s gonna be a lot of information here um But rewind it and re-watch it again after after the stream’s over um and hopefully it’ll it’ll be there when you need it like i said ask me things that you want to see me do things that you’ve heard i’ve done um i’ll try to do that um so let’s see if i can The first thing i think i want to do um is show you how to get a list of all your villages in your world all right village centers say let me start a new fold file and we’ll do it in this new file so i’m assuming that We’re going to stick with the same db um it’s already been opened so i’m gonna make an assumption that db is already open all right so next thing so i’m gonna do keys again but i’m just gonna get the village keys and do that it’s part of The new api i can do this get keys db village actually i’ll do it village um so jerry plays asks what program i’m in um i am in our studio so if you look back on my channel i have some tutorials about installing our studio and i’m getting it up and ready to Analyze minecraft so i’m gonna try this i’m gonna do key starts with village and then if i type keys and do control enter i will print out all my village tags in this database and you can see that we have what is it one to three villages In this world that have been generated um and so villages they are known um by having four tags one um saves the dwellers they’re down here one saves basic information one says information about players and poi all right so let’s say we wanted to look at the info of a village So we’ll take ke2 we can talk about keys too And we can save it to data um Uh get mbt value is the command And so this is going to read so get mbt value so this is a function that’s part of the new api and this is going to do is it’s going to read one of one key from the database and parse it as an mbt and if everything’s working right if i do this I now have our dat that’s been loaded if i do control enter we see that dat is a compound mbt object i’m still working on how these get all printed out um and i can tell some of these are not coming out right like here here they’re not coming out right um This one’s for off um printing um and these are the values so of the data so if we wanted to say do names of mmbt maybe easier to do i do control enter um these are all the elements that’s stored as part of information about a village Various sticking times i forget what all these mean um that’s the this is the village vh time that’s the village hero time um so that’s a timer um other things are um like the coordinates um of the um bounty box i can’t remember if it’s what’s Important if it’s r or not the rs um so let’s see if i can load up all this into a table so let me check the one that’s not showing up so that’s like bd time Yeah so it’s um so it’s displaying right here so good so we’re we’re um hopefully it’ll continue working so i’m gonna take next thing i’m gonna do is i’m gonna take like all the village info i’m gonna make it into like a table all right so to do that um I’m gonna take instead of doing get in i’m gonna do two things one i’m gonna now filter my keys So that we just get the info keys so i’ll call those eye keys um i’m gonna use a function called remember correctly str sub set yeah um actually i’ll change it without the pipe str subset Keys and i’m going to say info um why should you info underscore info dollar sign So this underscore info dollar sign that dollar sign to underscore info dollar sign that is a regular expression um in programming so that’s called a regular expression and so what it’s going to do this this str subset is going to return me all the keys all the elements from keys that end in Underscore info all right if i do enter and then i come down here and type i keys enter you see that we have our three input values the sdr subset allowed us to filter for just our info keys now if we come up here and we do i keys And we do get mbt data this is now going to return us a list of um villages so it’s gonna see so we have our if i do let’s see if i do like this names that oops names that we see that there are three elements in dat that are um Three elements in dat um that correspond to each of our info keys that’s what mbt data will return we’re trying to list of the thing of nbt values um where the names of the list correspond to the keys um so it’s kind of key value pairs Um where it actually records the key and the values from the database so it allows you to get multiple keys at once in a batch Um yes ninja pension this is me working with r um and right now i’m i’m playing with reading village data In this all right so we’ve read this we got our data parsed um and the next thing i’m going to do is and i think this is going to work um i’m going to do bind rose dat Whoops um names must be a character vector uh let’s see what so names that uh what is the type of names um character Then now what don’t you like oh do i have to do an unclassified unclass all right so now i think i’m gonna do so i get this to work right um Yeah let’s go map that i think this will work let’s see let me see seem to work let me store that as a value um give me a warning message not sure why oh and the printing um so if i now then look at that too in here i see um our Villages information in a table form um we see um i don’t know what all these columns means if old guy was here i think he knows what all these columns means um beauty time gd time m-tick pdtick um tick um i know vh time that’s a counter when you have a Here at the village after you defeated a raid so i think one of these is probably raid time definitely here’s the bounding box of the village um x 0 x 1 y 0 y 1 c 0 um z 0 z one that’s our village bounding box so now um Let’s say we wanted to find the center of a village which is useful like if you wanted to um a center village is useful if you’re building like a iron farm or something you want to check that you got the center right um in your map and so that is Um pretty easy to do from here so what we can do is use the mutate command um let’s do it like this we’ll do that three is mutate um tran let’s do transmute instead um that two so x is going to equal to remember our keys it was what x x1 x0 One yeah so we’re gonna do x zero plus x one divided by two y is equal to y zero plus y one divided by two and z z is equal to z zero plus z one divided by two um do enter and then actually let’s do ctrl enter and then let’s see input Let’s see what i do um ah righty right right i have not um because our columns are still stored as our mbt values um i can’t add them yet i have to convert them to integers first and so to do that this is what what is the command i need to do i’m Going to do so programmer asks what’s that operator and i can show it right here so if i do dat 3 this is equal to dat 2. what this is is a pipe operator so i can pipe um so if i do it just like this This is the same as what i did before right that three is dat two um and so this is sort of a syntax um here for um for for sort of composing functions so dat two pipe to transmute is equivalent to transmute dat2 like that What i need to do is i need to Do that two uh what’s the d plier command um give me one second look something up so how’s everyone’s day going um okay let’s see if i can get this to work right um all right so that too so now i’m going to do filter so i’m going to pipe it to filter Actually now and do not filter select and i’m going to select what columns i want so i want to select i think i can do x0 to z1 like that terminology let’s move this down right now if i do dat 3 um we can see that i have just the um Adjust the uh columns i want to modify oh so peter little says he built an ice farm based on my testing stream that’s pretty cool um i’m waiting to get back to that ice farm until we can upgrade to us to honest honors on exploit i may actually do some of that Here um but i need to use with exploit um that’s a good idea keep that in mind in my head um and wait until we upgrade and we maybe can test out the lack of block lag because i kind of like paused working on it Um because of block lag was pretty bad i didn’t think it would we’d lose a lot of efficiency if we um did that okay so that three um has just the columns we want i’m going to see if i think i can do this mutate um yeah Across i think this will work um as integer nope it’s not stormy in air So that’s across um What am i looking for syntax wise yeah should work to me i don’t have the syntax right aha Up across everything i can get to see if this one’s gonna work for me All right we’re gonna try to compose a couple functions i’m still taking dat two i’m selecting um i’m selecting all the columns i want i’m trying to take all the columns and convert them to integers there we go cool so now we all so now we have our table In the right format we want um so peter what was your um xp source when you did it i got the version on exploit to work with the guardian farm but still even that the block lag on the testing server was just so bad for various reasons Um so i did all this correct and i run it i should have the center of the village in debt 3. so there we go that is the center of the three villages in this world um on it oh so you found a guardian farm next to um ice as well that’s cool Yeah i i like that setup ice farm with guardian it’s kind of cool i think what i’ll try today is analyze my local copy of the exploit server and see if we can find um sort of like um all the spawners that are underneath um a tundra Um so that’ll be a good test um that’s cool so you so your gardening farm was you found um uh ocean monument that was below um ice that’s cool let me go ahead and save this as a note um folder all right so we got that saved um On this world um So before i do the next thing any like questions that people want to see me do while i’m here um you know i’ll take requests and if it’s something i can do within the time of the stream i’ll try to do something i’m related to it um but you know it’s not necessarily Like i can’t do anything code digging right now um so it’s more like you know looking for things um i could um look for diamonds i could um look for nether um rack um yeah another right something stuff like that um one thing i probably should do that i need to be doing Is um looking for mob spawners that are in frozen um tundra so uh so we had a request for the diamond ones um that’s a fun one to do and i can show you the block api all right so we’ll do this um We will do the diamonds so building so the question is how about building a um farm by the nether roof that doesn’t need any roof so that is a hard-coded you need all mobs in the nether are cave mobs so if you don’t have a roof over it um Don’t have a roof over it then you are not then you’ll have a surface cap and they have a kappa zero so nothing’s going to um spawn uh and so yes peter um we are looking to see if we can get a good source of xp For our ice farm um from mob spawners me for one reason is we have a mob switch on the server and mob spawners ignore it but um guardians don’t so if we have the mob switch running we’d have to actually if we wanted to run the ice Farm with xp we’d have to turn off the um the mob switch which doable yes but we don’t want to necessarily go that route unless um if it’s possible there’s like a good tundra that we can work with um and um so why not gold farms um they add extra lag um But yes i mean so we may end up using gold farms we also kind of feel like gold farms is a bit too easy might as well um take the challenge um and just see if we can build like a perimeter in a tundra with an ice farm in the bottom of it That has um things and yeah and so right now like we we’re not building you know right now on exploit pretty much what we’re doing is every it’s dealing with bedrock um dealing with breaking it or placing it um so once we’re kind of done with that we update um We can see but okay so diamonds people want to know how to find diamonds yep that’s about what i did peter i i use two guardian cells um per i think i use two yeah per two ice trays going back and forth yep i think i ended up with with Using two of the layers so bedrock breaking um dark oak and portals are the only ones i know of that currently work besides creative mode and i don’t have in all honestly you know there’s no reason not to use creative mode and just do it um If you for the look of it um you know if you’re at the point where yes you could start a world in point 100 delete everything and then move on but um yeah portals um dark x is the easiest but you can set it up in such a way that the net Where when you go into the nether The only place a portal can spawn is a place that will break bedrock but it is still a bit random and it’s still a bit annoying um and it best do that i mean um it’s mentioned in the dark oak one but not really described maybe if i ever do a portal mechanics Video i’ll cover it there get it working okay so finding diamonds let’s find some diamonds let’s start a new script so did this before for my kid um and All right so we have our database so so i can show you a couple things here first let’s figure out where our world spawn is and so to do that we’re gonna do We have our db path let me go ahead and close this db before i forget um let’s find our world spawn so we do level that is equal to what is it read um read leveled at db path So level that this is our um this is the this is reading the mbt data from our level dat um file in our world directory so if i just do names you can see all the information that’s stored in there and so what we’re looking for is world spawn spawn try remember Spawn mobs it’s all our setting i think it’s the spot x y and z’s all honesty Let me see world start count show tags mob griefing no I think it’s these three is what i’m looking for so we’ll do level that spawn x spawn y spawn z yeah so that’s our spawn um ignore the y um so 532 that’s our um spawn that we want so i’ll do this i’ll do i can remember it spawn x Um actually we can do it this we’ll get rid of the y because who cares and then we can do make sure i convert this to as integer actually we’ll do it so that is a list so we’ll do unlist and then should be good to go spawn we’ll say spawn all right Um so i have our spawn object and that tells us it’s 504 32 and it’s gonna save me a lot of time if i just record it here as well this world all right so we spawn so we want to find things chunks near spawn that have that um So now we’re going to open our database again We’re gonna now do keys again keys is get keys database then um i’m gonna go ahead and parse my chunk key so i’m gonna save it to value Um let’s do chucks um let’s chuck that there we go uh is parse chunk keys keys and so if we look at chunk dat now what it is is it’s a table like you saw before um specifically it’s a tibble um that’s tabular data and so what it’s Going to tell you is you have your key and then it’s going to have extracted out all the information from the individual things um so you have your x your z your dimension um so zeros over world one is nether two is the end the tag so this is the um This final value so so 44 is equivalent to the chunk version 45 is 2d maps 47-0 is the lowest sub-chunk etc etc um so now we’re going to take our chunk data and we are going to filter it to find things that are near spawn To find chunks near spa and so to that we’re going to say dimension is equal to zero so overall chunks here’s the dimension of zero and let’s see we’ll say X minus so 502 but 5×2 is actually a chunk coordinate we need the actual um We need the actu so 52 502 is a block coordinate we need the actual chunk coordinate and so we’re going to do spawn parentheses divided by parenthesis so that’s going to give us integer division so we’re looking at our chunks is 31 and 2. so we’re going to say our X distance of 32 31 squared Plus y minus two squared um these can in r you can use either double star double asterisks or even um a carrot to um the exponent and we’ll do square root so we’re using an euclidean distance um so this is going to give us um our distance from our Chunk distance from our spawn chunk um we’ll keep it small um let’s do it less than three let’s do less than five all right and so that’s going to be our like our first round so we’ll save that to dat actually oops missing a parenthesis somewhere filter parentheses Square root oh all right missing one we have an extra one and so what am i doing um problem filter input one object y oh not y z all right so here so now we have our dat so dat should be all of our chunk data that is near our spawn um Oh hey old guy yeah you missed uh me working with villages at the beginning sorry about that um and uh let me actually do this and all right so so what have we just done we took all of our chunk data and we filtered it for all the rows from the overworld That is within five chunks of our spawn location our spawn chunk okay so now where are diamonds diamonds happen in the i remember correctly the lower two sub chunks am i right on that below 32 say they’re below 32 um and y level um so i’m gonna add another filter here We’ll do subtag is less than or equal to one all right and so dat is equal to chunked at um that’s been filtered for the overworld dimension chunks that are close to our spawn chalk and the lower two sub chop lower two sum sub chunks and so this should work uh If i do ctrl enter to run it and now look at dat again um i see that we have all of our sort of keys that we want so now this is the fun part um i can then take our keys and i can do i do let’s do blocked at Now i’m going to do get sub chunk blocks data so i press tab to complete that i’m going to do dat keys oh what am i doing oh i forgot to put database um database dot peace and now we’re hitting uh bug gets up chomp blocks data that ease Why are we not let’s do dad keys i mean what’s wrong um it’s probably cause this needs to be that key that’s what it is that key there we go So if you look at this i’m going to be a lot of data we’ll look at the first one so what is blocked at so block that is a list of arrays so three-dimensional arrays each one refers to the blocks in a sub-chunk um and so if i look at So if i look at the first one um or actually i think i can do if i say this to a temporary variable and then where’s my b i think i can show this let’s are you gonna show it to me if i look at it I don’t think i can i’m gonna do view b yeah it’s not gonna it’s not gonna give me a nice um look at it because it’s three dimensionals um let’s see how we can show this so we can do so we can access the first element of block dat With a double um square brackets and i’ll say that for b for now and then let’s say we wanted to look at the lowest level the lowest y value so we would do this b one comma one and this gives me a matrix and if you look through it uh Vector you will see that it is um all um bedrock lots of things here i’m gonna do names only so this is going to strip off this part of the block information and our output that’s going to make it a little bit easier for us to work with and we don’t Lose anything since we’re looking for diamonds all right so we’ll do b again and now i’m gonna do b And then we see our um our 16 by 16 first level of blocks they’re all bedrock okay um so how do we find diamonds well the easiest thing to do is we use it we say take block data one And we ask it if any of the values in block data one are equal to minecraft diamond i think it’s diamond ore um and that’ll return a bunch of true fault values in the same framework we can eyeball it doesn’t look there’s lots of diamonds in this one So we can do say some four so there’s actually four diamond ore so let’s see if we can see um where they are in this chunk so do that we would do if i remember correctly which i’m gonna turn array indices um the a rr True so this is going to do is which is going to tell me what parts of this chunk are the sub chunk are diamonds so the coordinates 15 11 11 15 12 11 so these are all um the coordinates in the chunk that have diamond door And so i’m going to save this to an o real quick a temporary variable now i need to actually convert this to world coordinates so this doesn’t tell us much so do that so i actually have a command in our bedrock to do that um that means sub chunk chords Um o for the indices and the origin of this chunk and so it’s gonna be the first one so let me pull names block that the first one uh let me go let me see if i get this right yeah and the first one got to make sure i’m doing this right i May need to get fixed something All right so we’ve got an error here that means my sub chunk chords function is broken um it’s to be um potentially expected because i’ve been doing some api changes um why am i selling to binary operator so this is where let me save this Because i may have to come back to this code in one second make sure i save it i’ll save you because um all right so now let’s figure out um What is wrong with my code blocks blocks blocks okay so for function O is f origins so i can do it manually real quick and make sure i get this right this is where the error is um um so jed’s asking about an error and get keys um jed if you haven’t updated our bedrock in the last two or three days you won’t Have get keys on it so this is something that i just um i just pushed i had in like a couple days ago so you need to install from github again to pull in the get keys function all right so let’s see what’s going on here so uh peter asked how’s my instructional Design you mean for my course in the fall um well my course in the fall is in the fall and so actually it’s not actually even until october um so i’m probably not gonna start thinking about what it’s all gonna cover until like two days before it starts because Yeah that’s how that’s what we do um it’s a thing about syllabi um everyone always asks faculty for their syllabi and we’re like yeah we like to see it too um i totally don’t do my syllabus until this till like the week before the semester starts um because why um why do it Um yeah um all right so let’s get back to trying to figure out why i have this error and fix it so i knew this was going to happen at some point in the stream it was stuff i would need to fix and so i do this on purpose Give you a chance to kind of see how i how i develop our bedrock um all right not numeric so what’s what’s that is it is o in the mirror integer okay that should be so y but then that’s the origins oh is sub chunk origins broken maybe What’s that subject origins may be broken um that would make sense it doesn’t return anything that is our problem let’s bet box is sub chuck origins why yeah it’s a keys what’s going on here so that is the problem my music stopped let me get some more let me get the next one Um all right let’s get it back let’s see what’s going on um subtract origins is not returning is so it should it’s probably the split chunky um function uh let me do we close the database So close the database um Let me see if this will complain i’m actually session restart r So i’m restarting r and now i’m sort of loading up it to instead of run r from my global directory it’s not going to load r from it’s not going to load our bedrock from the local developmental directory so i’ll do devtools load all to do that um so let me Double check sub chunk origins now that i’ve done that right so that didn’t turn anything so what’s going on so let’s i’m gonna come over here i’m gonna run them one at a time split chunky’s doing somehow split chuckies at 27 0 0 47-0 all right so that returns the correct thing Am i not doing let me put maybe that’s all i need to do now that i look at the code maybe it’s returning things invisibly actually i don’t even do that i can do this is what i want to do Devtools load all and then do sub chunk origins boom there we go so basically what i was doing is i wasn’t returning my value if i was returning i was returning it silently so i changed subject origins um so it would make that change and so now we’re back to finding diamonds So let me go through and source everything uh probably it’s going in a different order what are you looking for you are looking at Um i want to source it i want to run it sorry All right so it’s still same problem yeah your eye locked Um let’s try this again Run you okay good run that line right let’s see if this this is going to work for us all right dimensions what’s up that’s a chunk that sometimes i spelled dimension wrong Should be fine Is working Oh i haven’t learned a tidy burst that would help yeah a little tidy verse now this should be fine there we go i was pulling the wrong filter function um hi shady um right now i’m looking for diamonds Um and so All right so that little bit of fix um locked at test this out same hair as before oh that’s db reloaded the functions did not since i after i mod after i fixed sub chunks i don’t think i maybe i did reload it um that’s there Now we got the same problem we had before um what’s up chunk origins let’s try this again origins yes that’s correct that was actually not our problem all right back to sub chunk chords let’s see what’s up um Let’s see is there something wrong with oh those there so this is our function let me just make a copy of it here f so i did this right i should be able to say f o chunk origins and then pass it that string we’ve been working with which is here Well remember just about origins all right so we have our error so air is an f um not oh now it’s different non-conformable arrays all right ah i see what my problem is definitely see what my problem is now i’m going to get rid of this array index Equals true in this one um because sub chunk coordinates um he’s going to do that for us okay so control enter so now if we look at o instead of being a three-dimensional set of coordinates within the block it’s now like a one dimension does it um just and then Now we’re getting the same error all right come on non-numeric argument to binary operator um f o what do we get f o our previous one and now we’re gonna do origins um at 27.00 47-0 not verbal arrays so why don’t you like me though hooray index Have a sense it’s something very silly so that’s right do t do that to transpose it and then i want to add this to our subject origins at 27 0 0 47 just forgot to misspell origins right and it’s unhappy with me should be oh is that because I changed how origins does it all right right so that is being returned now not as a list i see i see i think i need to put because i’m using one value here i think i need to strip off the make sure i do this right the dimensions there we go devtools Initially hello devtools All right we’ll do devtools all right so if we did everything right this should now work for me and we didn’t do everything right Why are you having problems with me let’s try again with vector let me right here it’ll help me let me copy this function so i can work with stuff here all right so what i want to do is x is going to be our o that we have before Y is going to be our subject origins of this thing Hey i know my problem i know exactly my problem i know exactly my problem i’ve been using some chords wrong as well i need to do this Actually i need to do this if is character origins so i’ve been passing the keys as characters uh well i didn’t write this function to do anything with characters as key so that’s why all the stuff’s been been breaking down but i can make that change real quick That if it is a character run sub-chunk origins as well not just if it’s unspecified So this little piece of code should convert um character names to the sub-chunk origin so if you pass in characters so let me do devtools load all and then boom profit so these are the location of four of the diamonds in my world parker lee i don’t know what you mean by Boat puller behavior um so if i clean this up so that’s for one sub-chunk what if you want to do this for all of our sub-chunks that we have in our block data we can do block that and we can use a map And in this case we’re going to do what we call diamond at we’re going to pipe data to map we’re going to do we’re going to create a function so what map’s going to do here is it’s going to run this function on every element in the block.list And so in that case we’re going to use this this is our function but so here x so map’s going to be like the first time map is run it will be run on the first element down the second element then on the third outlet so it’s a way to run um Everything together so if we run that and we now look at diamond at we see that um we have our a list of integer vectors so look look this is a um this is a nice sub chunk we got one two three four five six seven eight nine ten eleven diamonds In the sub chunk right here kind of sweet kids would love it um that’s what we see is that we have a name so this is a named list um i’m probably easier i do a head so you can see everything um so this is our named list And what you have is you have a name that’s our chunk coordinate followed by a list of integers which are the indices within that sub-chunk where there are diamonds okay and so now what i’m going to do is i’m going to then pass this to sub-chunk chords Which if i have everything written right should return me a list um of where all the diamonds are in this area around my spawn point so if i try this again so i then take um we’ll just use this map function again we’ll then pipe this to aftermath we’ll then pipe this to Um sub chop chords and see how what this gives us don’t know why i’m doing that um diamond dat is now has um sub chuck chords for everything um now last thing we’re gonna do is is robin and i think we are in business and it’s gonna complain to us um And it’s going to let’s do here which is the thing i want to do to bind all these um because it’s matrices um and nope doesn’t do that um because it’s like a list um i think if i do this do you call i don’t like doing it this way um But that gives me what i want um i’m gonna find a better way to do this um so the problem here is that so we have a list of arrays trying to bind all those in the list our bind doesn’t do that it likes like individual um arguments but do Call is a way to sort of take a list and pass it as um arguments one and after a time to our bind um i don’t like it that way so let me try let me try cleaning up the other way so that’s one way to do it To get our one final list um i just do unlist no because then that flattens it because we have to um maintain the dimensions after we do it which should be bind rows but that tends to work on data frames let’s see it’s gonna complain about everything so then i want to do Can i just do map dfr man yeah it’s gonna be the same problem all right so then i could convert them all to tibbles um this is a possibility um okay unlist them pass them to a matrix and recreate it um i guess do call arbin is probably the best thing to do So um so we’ll do that to create our matrix now if i look at it um this is now a list of all the diamonds all however many of them there are so it’s like 174 diamond doors within five chunks or so of my um spawn spot So you could do something like this print it out give it to your kids and tell them to have fun finding diamonds finding yeah it’s like a treasure map um so that’s finding diamonds a little bit of code changes um let me save this all right so where are we on Code good that still dates um all right so what do you want to look at next anyone got any ideas so in principle you could do the same sort of approach for any block that you want so What do i want to do next okay all right let’s see what do i do let’s let’s do some graphics next um in this world let’s do let me close my database where i forget all right so let’s oh yeah um definitely have that code i don’t know if i’ve adapted it to This yes so peter little says ask for finding spawner clusters um yes i do have code to do that um and probably need to adapt it um a bit to the new layout um don’t feel like doing that on this stream um maybe later um i would do some graphics things Um let me see Let’s go db path i’m gonna try to draw i’m gonna try to draw the biomes in this world so i’m gonna try to do something different We’re not going to be able to see it so let me move this up A corner yes um i need to update uh something so there’s a background to that thing oh well um yeah um so we’ll do the next thing we’re gonna try i’m gonna try to do biomes and remember our 31-2 is our center actually probably i’m going to use this Filter again so i’ll go ahead and copy It will not use subtag we’ll do more than five we’ll we’ll plot it out to ten yeah tell me don’t give us a good look um all right so we’re gonna look for um biomes let me start with [Applause] All right we’ll get our dat we’ll get our chunk data loaded um we want is 2d maps to 2d maps that’s where the biom data is stored and then we don’t even need to filter it here we can go here okay um so now i’m gonna pull the biome data From all these blocks if i remember correctly i can do it like this that two is equal to get biomes data db and dat dollar sign key and if i do head dat 2 um you see i now have a um list of arrays of biomes let me quickly glance through this um So it so what we need to do is convert this into a um they see a table for everything so to do that um what i need to do is i’m going to map all of our data to see what we can do is right um that too map two Yeah well get our so what i’m gonna have to do is get the um chunks that Um so i have to get the now all these chunks that we have here i have to get their origins so to do that we will do say pass is equal to chunk position names f2 Names i look at this hopefully well it’ll have what i want yeah so that’s our array this is our chunk pass that’s not our block let’s see do i have Did i have it converted let me go back to my keys function let’s see did i write a function to do what i’m trying to do now um oh chuck origins not jump positions i thought something was off Okay so now if i look at pause and i have the chunk origins of everything so And then i need to convert this to a list so i can use it for the next thing so um so i believe that function to do that is going to be array branch um It’s either gonna be array branch or another one we’ll find out yes a 32 no that’s not what we want Looking at the help function uh rare branch directory and so array tree creates a higher list that has many levels as dimensions a ranch creates a flat list along all mentioned dimensions um error tree creates a higher list that has as many levels as dimensions so one per dimension um Let me see what am i looking for um Yes i want to re-branch probably the first dimension see yes this is exactly what we want so what i’ve done is i’ve basically take taken every row from chunk origins and turned it into its own element in a list that’s exactly what we want to do in order to Pass it to the next function which is map2 so dap3 is going to equal to map 2. so what this is going to do is it’s going to run a function over pairs of values one from that 2 the other one from pos i’m going to do our function x And y and so here x is our array of um x is going to be our array of oh what i say it’s an it’s our array of biomes for that chunk and y is the origin for the chunk so we have to convert this into a table is what we’re working for And so our table is actually while i’m working on this let me do there’s that too but i’m going to do head i’m not going to do all of them i’m going to put a head right here so this will only do the first couple elements of that too Um we’ll fix that later all right so now we’re gonna do that and we are going to do so that’s that function so that’s um map so we have to do we have to create a table here so we do is we need to figure out what our x indices are our z Indices are and um Yeah so actually since i’m going to use xd i’m going to change this to a and b uh for the functions and so actually we gotta do head pause too so it’s not gonna complain all right so head pause head that too all right um so we need to create a Matrix so first let’s think about what our coordinates are for our x’s so our x’s they are going to go from b1 to we’re gonna add zero to fifteen and our z’s are gonna go from b plus 0 to 15. all right so that’s going to be the range Is we’re going to go from the first element in b All the way up to 15 beyond it and that’s going to be our x coordinates of our chunk and z is going to be our z coordinates and so now we gotta turn that into a uh a two by two matrix and so if i do uh turn this into a grid X x is equal to x z equals z and we’ll take a break from there and we’ll run this and see how it looks so if i look at dat three um let’s see if i can see it oh i can view it uh although i’m working in our cd right Now um i don’t actually use it a whole lot in my um when i’m working so yeah so we have xz xz coordinates i need to ch so we need to go back and check the um our dat2 data to see if that’s the format i think it’s reversed i did that too Um that too yeah so this is so r is r is zero and is column b so it’s going to go down the x first which is this first element like this and then hit here so x’s have to vary faster than z’s in this grid so um and so to fix that Um well we just have to know that um that is not a big deal and so this is that this is going to be the beginning of our return it’s going to be expanded grid and we’re going to do red biome we’ll transpose a and then that should work We’ll find out if it does yep that does not like it um because of the rose so to do that then we will do Um a believe it’s as vector there we go this is going to turn it into linear which works with our data so data3 that three um head it’s gonna give us um uh wait what oh i forgot to once again did it before have to return Our result so it gets passed all right so let’s try this again and we see we have coordinates and biome all right uh that’s looking good so now we can do change this to dfr um and that’s gonna actually instead of returning a list of tables we’ll return one big table Um bound um on the rows and that gives us that three so now we have one row that has a whole bunch of biomes so we’re now we’re gonna come up here we’re gonna remove our heads and so we’re gonna do this for our entire area and this is gonna give us our Data that we’re gonna plot all right so now we have about 78 000 observations of biomes so what can we do with this um before we plot it i’m gonna do a simple table i was gonna count how many of what biomes are in my thing so i’m gonna do table Um that three shifts uh dollar sign bio and we see that um near my spawn point i have frozen rivers ice mountains ice plains rivers tigers and tiger hills And um now then let’s see if i can plot this All right do that i’m going to use something called ggplot and ggplot has its own kind of syntax in r um in its own kind of layout uh sometimes it takes me a bit so i’m saying gg is gg plot dat three um a yes this sets up our mappings um X is x y equals z this is gonna set up our that when we do a 2d plot the axis is going to for our x and z data is going to be pulled from our x column of our data and our z column of our data And then our we want to say our color is going to pull from our biome Um bill i think it’s phil Now now we’re gonna use a plus here to say it what we’re gonna plot and this time we’re going to do i think we’ll do tile geometries and so this does is it kind of creates a drawing object so when we print it we get the figure and so if you can see It here Um i now have a map down here in the corner that says um sort of along the x and the z so the z is actually reversed here um this going down is north for the z um but you can see that i have a tiger up here on my world um Ice planes some ice mountains um tiger hills A river and then becomes a frozen river uh what else do we have down here another river another frozen river and the ice plains um ice mountains um And then um let me see if i can get the colors so i do a couple things uh first i’m gonna do is i’m gonna try to fix the axes and then i think i need to do is it scaled Let’s see easy gg plot reverse y-axis Then i have to search for all the time to remember how to do it Scale y reverse that’s what scale Let’s so now we get what we expect and Um now we get what we expect in um looking at like a map north south east and west okay um But our colors are all wrong right i do have the colors listed here and um in our bedrock so let me see if i can get the if i do biome let me go here biome list and our oops it’s list biomes um i have like a list of all the frozen Oceans with ids and even the color from the game um i haven’t done this yet so let’s figure out the best way to um link these up uh for ggplot so let me custom color let me google it real quick um custom color gg plot let me also let’s see what’s my let’s See how we’re um i’m doing with everything come on internet how do you do i’ve done that one let’s see let me see let me find the command i want to use ggplot Here’s what we’re looking for is i’ll pull it up on down here help scale manual all right so look for a scale color manual fill manual right um i don’t want palette i want breaks scale screen i know i want aesthetics um i need something that’s gonna convert between the name And the color So Okay so we need to do named vectors right here this is what we’re going gonna want um so we’ll set one of those we’ll build that up from the list biomes so do that um let’s see we’re gonna do Let’s do v actually we’ll do color is equal to list biomes color we’ll do set names we need to give it names that’s gonna be from the biome so we’ll do list by ms Name so set names is gonna there’s a function for creating a named vector so if i do this and i look at it under call come on check to me i’ll do it down here you see that we have a vector of color so these are Um rgb colors so each one of these is the red green and blue hexadecimal values each one of these is associated with the name like plains desert i believe if i do this right i can do scale bill manual values equals call and this will all do what i the correct thing There we go um that is now a map that we’re used to looking at in minecraft Hello kodara Let me save this little note and then let’s say as well now that’s our biomaps we can add some more things to this um what i’d have to do i have to look to see how to add i could do separate points um let’s see if i can quickly let me see if I can quickly add some points to this let me take a take a quick two minute break um and let me get a drink of water um and i’ll be right back oh oh Hmm hmm Do Um hmm Do So All right so i’m back um So um my internet being iffy again i’m definitely not hearing any music yep that’s loading too all right so hopefully um i’m still streaming we’ll find out um yes so so what this is going to load is just things that are already loaded in the world and um that’s um what The um our bedrock does it doesn’t generate a world for you you actually have to give it a generated world and so um let’s see if i can get the music back up let’s see if we can get this music back up um okay um let’s see um How well my internet’s doing nice that’s able to read it so good i can see that i posted um But now then firefox is unhappy with me all right that was good let’s see if i can play some more music there we go and let me reload see if that helps um all right let’s get back to what um the questions were i think my internet’s slowly coming My browsers are slowly coming back up um so far it’s not reporting any streaming issues on my end but hopefully um we’re still here all right um Hopefully nothing about just streaming into the void is where i’m paused here um so let me do the last little thing i need to do where i quit today um last thing i want to do Is come on youtube wake up and tell me that i’m still streaming come on all right my phone tells me i’m still streaming so i’m good uh i can’t see chat right now my browser’s not working with me but my phone says i’m live all right i’m gonna Keep going what i’m doing hopefully it’ll wake up and i’ll see chad again i’ll try to pay attention um all right so this is you know one way to plot biomes in your world um it’s for a large scale plot it’s not the most efficient way um there are um Better more efficient ways to like turn this into pixel data um but i’m not going to go into those today i’m going to try one last thing um and show you how to find the location of mob spawners in your world and then we’re going to plot them on this map um So the way to do it is i’m going to do let’s see i don’t wanna um mom spawners or actually block entities so we’re gonna get all the mob spawners that are in the the section that we’re printing so block entities or i’ll just say bees Oh dude call them bees uh black entities or bees um we’re going to get block entities data db and then we’re going to do the keys that we used earlier so that’s going to be dat key what part of this these functions do is look at these data is going to take all These keys that are listed and of the keys in this data set that contain block entity data it’s then going to parse it and return it so you can parse extra keys no problem but it’s only going to return values for the block entity keys and so block entities these are Um sort of blocks in the world that have associated mbt data and they’re set up internally as block entities some people call them tile entities um but they’re internally known as block entities um so that’s our b’s data um and this is going to be a list of mbt values Uh so if we look at like these one um that doesn’t show up well um let’s do strings refer to a string this sometimes allows us to see what’s going on better um and it gives us um sort of like nbt data with various different tags like locations and stuff I can tell this is like a spawner right here um and it’s the first thing i want to do so this has a block new days from a whole bunch trunks i’m going to sort of flatten all those together into one list um and to do that I’m gonna do it block entities data flatten i believe is what i want to do and now this is gonna actually return me one large list of 120 if you look over here 120 um block entities that are in My list um no more so far no more chats let me double check my phone see the chats all right some of you are here i may just be here by myself all right um i’ll finish this out for anyone who’s still watching this watching the stream later um so So now flattened the stream um i flattened our list and the next thing we do is i’m going to filter it um And that’s going to be using the keep um hey ian i kind of see your stuff what i’m doing right now is fighting with youtube a bit because it’s not showing me chat so that’s what i’m mostly doing right now slowly trying to finish out the live stream Um but youtube is not happy with me right now um it’s still streaming but it’s not showing me my chat um when i refresh maybe i’ll switch to a different browser Okay i’ll log on to youtube in this browser give me youtube studio i don’t want it to create a new i don’t want to create a new live stream hopefully this will work yay i’m back i’ll ignore you livestream’s back okay this is more comfortable all right Um yes to answer your question ian um i am flying around in our bedrock trying to sort of go through a stream and go through various different ways to analyze um data um in our bedroom right now i’m playing with making maps effectively if you see down here in the lower right corner This is sort of a map of a world that i play on with my kids a little bit um and you see there’s tyga tyga hills plains ice mountains all near sort of our spawn point um sydney right now what i’m doing is i’m finding all the spawners In this area and i’m going to map them i’m going to add them to this map to kind of show people how to get um spot to get like mob spotters next one’s gonna be i’m gonna do keep the keep function and then i’m gonna pass it dot um name Um i think this will work um probably x is not true okay so that’s not what we want um so we’ll just start here i’m not flattening yet um let me do Map that’s because that’s not idiot’s id yeah so so this function mattbee’s id that’s going to return us um i’m going to do it like this matching chart that’s gonna return us the name of everything in what’s up with that but um the name of uh sort of all of our Elements in this list hope that makes sense um so that’s gonna return us the ideas of everything we can also do though is these keep Sorry judge you fell behind um it’s kind of hard to um sort of make a tutorial that people can follow on the fly um especially when i run into bugs and i have to get fixed and you’re not in the same room with me like a student he would be like wait Slow down also the two screen problem is really hard in this sort of environment all right so now we’re gonna do keep um and then if i remember correctly mob spotter i’ll explain this little command in a second Spawners once i get it to work so you’re not liking this um yes what are we looking for keep yeah that’s what i’m not doing right i need to do a squiggle oh and that’s also A problem because i haven’t written some functions to do what i’m trying to do Yeah so then that’s not gonna work i need to so i’m missing um a function in my our bedrock um api that allows me to do this from the bug report so we’ll do it a separate way we’ll do it back to what we had before And i want to know we’re going to get um we’re gonna map to a character b and id so this is like a syntactic sugar um that’s gonna pull all the id elements out of our block entities Um so we’ll just save that to vector called ids so now um everything got converted to a character you see all of these now if i say ids is equal to mob spawner um we get a whole bunch of true fault values so this is going to tell us this Is going to be a vector i d z because mos bar is going to be a vector of true false values that we can now then use to subset our rb’s if i do this um we’ll comment out that code since it’s not going to currently work um then we see our spawners We get 11 information you know 11 things with mob spawners now what i want to do is i want to try to turn this back into a table like we did earlier with our um with our village data and so to do that you remember we want to map this Dfr on class what unclass is going to do is it’s going to sort of strip off our class information so it’s going to basically strip off this information that we’re dealing with um mbt data and i’ll go back to like the raw list data that’s going to allow map dfr to To work with it properly and then so now we can look and we now got spawner data a table of spawner data we got entities um Max spawner delays in spawner delays all this sort of information what you can note about this is that you can go in with an mbt editor in your world let’s say you’re making a custom map And like really change up spawners like you can make them spawn from way off you can make them spawn a lot and spawn in a wide range Um you can even make them spawn fast like really like pump out the mobs and you can see a current delays looks like we had one of them that was accessed recently a zombie spotter that was activated recently and what’s important for us right now is our x and z values Um So we are going to let’s see if we can um get this spawner data added to our map um i remember how to do it so we’re gonna use gigi this is our map from before we’re going to add to it a what am i looking for i’m looking for I forget the command An annotation All right i think i did like this um X is equal to point drop point i forget i can actually test this out right g point there we go we wanna do point is gonna add points with the values of x is going to be equal to spawners bar sign x or the x column and spawners and y Spawners actually let me make this a new so i can see what i’m doing And spawners z I do this right i can then do um print gg and i’ll get a new plot And um make sure we convert this to integers This is basically going to strip off the class data um on this Uh that’s gonna this guy i gotta recreate it here so let me copy this let’s just make it easier To work with Like that it’s annoying there we go There is the map of this part of the world with the location of spawners each spawner indicates so we actually have if i look at 11 so 1 2 3 4 5 6 7 8 9 10 11. um now i might as well put in what did we have earlier we have um Yeah and i believe are so if you look at the center so it’s gonna be like 32 and two and zero it’s like 500 it’s gonna be like right around in here is the um location um of my spawn actually if i just did it it’s Right in the center it’s gonna be here and here she looks like um is where the spawn location is for this world um i do know that i think these are two zombie spawners that are um within spawn distance of one another so um i may end up building that one day on Stream um with my kids as a um double spawner and if i did one more change up let’s see if i can let’s see if i can bill is going to be um let’s see wait what’s this bonners what do we want into the identifier that’s what we want Ask character it’s the identifier i did this right uh Again This works for me okay um i’m known color name um i’m trying to use it as a color name um As factor maybe i’ll do it if i do it as a factor I’ll see this let’s see if that works for me and i’ll explain it in one second so didn’t complain yep it does still complains um I may need to do something else do what i want to do here um trying to color each of our points differently yeah it’s not good it’s not happy with me all right So um i will need to give you one second uh we’re gonna do color let’s do i gotta see what all the different ones are the quick uh unique spawner into identifiers spider zombies and skeletons um so and then once we have spider zombies and skeletons we’re gonna do Uh we’re gonna make a little named vector color map kind of thing um we’re gonna do s color it’s gonna equal to Okay red And then Minecraft is equal to gray let’s see how that looks and then we’re gonna do s call what we’re going to do spawner s color not as color um as character spawner shift um into identifiers all right so we’re creating a vector a named vector and then we’re gonna take that and basically What this it’s going to do here is it’s going to match the names and so we’re going to get if you look at s call now Colors that correspond to um our spawner types so if we do this correctly If i’ve done everything correctly Let me try this again let’s go really that long there that’s fine um let me move this up and get it out of the way oh let’s call that’s what my problem was all right so we’re gonna make our our gg again i’m gonna do it again if i print it We now see our um i see these were skeleton ones um So he’s got a spider here spider here three zombies here two more zombies skeletons um spawners um and yeah hi micah um you get used to it um it is nice at times to have zero indexes when you’re dealing with like coordinates and stuff and it is a Bit weird we’re trying to convert between like internal bedrock data structures that are zero based with coordinates and stuff to r but um works okay yeah so that’s this is me plotting um all the colors with that on for the spawners within this part of the world those points So i think i’m going to end the stream here um so if there’s anything you want me to see um about you know analysis of an existing world uh be sure to ask in the comments join my discord asking our bedrock because you know get a list of um things going That um yeah maybe i could do more streams like this um hopefully build up um people having you know better skills with our bedrock also helps me uncover things such as this um working with mbt data such as this not working um and like each two that has to do with me not Implementing certain functions yet um i know kind of what to do to fix it so hopefully um you’ve all enjoyed the stream i’ve enjoyed sort of working through things making changes to the code base as i go and plotting some of these data sets all right like i said if you have any Questions and about certain things that you want to do um ask in the comments below or in this in my discord and we’ll see cheers Video Information
This video, titled ‘Analyzing Minecraft Live! An Rbedrock Stream.’, was uploaded by RufusAtticus on 2021-04-18 02:23:13. It has garnered 635 views and 34 likes. The duration of the video is 02:33:50 or 9230 seconds.
In today’s stream I will be using R and RBedrock to analyze some of my minecraft worlds.
Topics Covered: – Finding Diamonds – Finding Spawners – Mapping biomes – Calculating Village Centers
Join my discord at https://discord.gg/sWb4YmX
Links ===== https://youtube.com/rufusatticus https://twitch.tv/rufusatticus https://cartwrig.ht/
Discords ======== Analyzing Minecraft: https://discord.gg/sWb4YmX Xploit: https://discord.gg/HUxgfG7 Advanced Automation: https://discord.gg/6fD8CR8 TechRock: https://discord.gg/BNjvWgX