– oxy oxy done minecraft monster today I’m gonna teach you how to add a container to your block so if you don’t know what contained is it’s actually where the slops are just says wood slots are which is many use for the gy so what we’re gonna be doing today isn’t Actually gonna be visible until Thursday I think so first thing you want to do create a new package and yes these are new icons you won’t have this this is just me Ivan sort of plug-in to it which is Google stuff so that’s just for me so CJ my craft up we have every friend container so you want to make container on and you want to add in here container mini chest so pretty basic stuff this needs to extend a container patrol shift Oh to import that and obviously it won’t let me because I need To save it and import it so you want to do the net dot minecraft our inventory one and that’s gonna make us wanna add some methods so it can interact with that’s only gonna make us one make one method which we’re not going to do right Now so the first thing that we want to do is we want to add a constructor so press control space and win it Oh gate there we go constructor and this is going to take in a I inventory layer inventory Sony we’re gonna get the play inventory I’m also going to get our tile and this at all entity mini chests and I’m just going to call it te and in here your son of control shift o to import them so then now we want to have a private tile enter two mini chess here and Just go up te just need to set this as this dot t e is equal to te yes so we just a nut so now we’re going to add a can interact with which we have to have which will stop up from erroring and what we’re gonna do here we’re going to Use up te that we just made and it going to be this dot t e dot is usable right there it’s just gonna take in that player so that’s basically what we did last tutorial so we had in here somewhere in here yeah this method we Don’t need to repeat that we don’t need to repeat that we got up there so here one do this doctor ad slaughter container a new slot and inventory so we’re gonna have tile into T first and the index is going to be 0 so mines only Gonna have one item slot so that you just like take away one so if you had like nine slots you do this from every single one from 0 to 8 that makes sense now you actually want to go get your image so this is my image here when it Opens so I’ll probably also have this on screen and basically from here we can work out where to do it like get the x and y position so so here we go you see that this is what min chest looks like so you just left a couple of pixels here And basically what we want to do to get the location of where you want the slot you actually have to find a slot and look at this bit here so if we look down in the bottom right probably higher like this if it’s a T 16 so 80 and then 16 They are at locations and then we’ve got to do this for the inventory so we need to actually say like these are the players inventory stop slops so this method here will do this for us really simple and this here this 41 plus now oh pretty much every single Every single gy in the game is a 176 pixels wide so here we don’t need to change the x value and that x value is this one here you do not need to change this at all unless your once wider but here 41 and 99 this is the hot velocity Inventory so the hot buyer if we get here that’s 99 in bottom right so that’s the y and then here for this one it’s that 41 which is the top bit here and it says 41 so that’s just how you know what that is now there’s another method that We can add which is transfer stack from slot which I’ve also gotten a description a link to this code because I don’t really someone spent ages just doing it so ctrl shift oh that will just do that and basically this is going to transfer so what like when you shift Click your last shift clicking to work so this this just does that and this number here is how many slots it has this number here is how many slots it has and it’s number here is how many slots it has so pretty much we can’t testers today but I assure you this Works so thank you guys for watching don’t forget to Like comment and subscribe don’t forget to check out the next tutorial because this this to Tory’s really needed for the next tutorial to work so I’ll see you in the next tutorial up don’t forget to watch any of my previous videos Oh So yeah go check them out Video Information
This video, titled ‘Minecraft Modding Tutorial | Container (1.8.9)’, was uploaded by CJMinecraft on 2016-04-04 16:30:00. It has garnered 1121 views and 17 likes. The duration of the video is 00:06:45 or 405 seconds.
Watch todays modding tutorial to discover how to add a container for your tile entity which prepares us for the next tutorial about the GUI.
Player Inventory Method – https://goo.gl/ZWS9bG Transfer Stack in Slot Method – https://goo.gl/P8n3Rx Mini Chest GUI – https://goo.gl/06qJds
Don’t forget to like, comment and subscribe!
Links: ►GitHub – https://goo.gl/YkQYpu ►My Website – http://cjminecraft.theclever.me/ ►Modding Tutorial List – http://cjminecraft.theclever.me/modding-tutorials.html ►Modding Tutorial Playlist – https://goo.gl/ZnZWTd ►Facebook – https://www.facebook.com/CJMinecraft01/ ►Google Plus – https://goo.gl/3n1umj
For modding help or if you want to contact me, email me at [email protected]
My Schedule: Monday or Thursday: ►Modding Tutorial Wednesday: ►Qbeh-1