Hey guys mr. crayfish and welcome back to another modding tutorial before we start this episode today salary guys had a problem with this set unlike last name I looked in the comments and a lot of you guys were saying that it was undefined and the reason why it’s Undefined is because you most likely haven’t created this item table class so if you look back in this tutorial I how I highlighted over this and said create a new class and it created this new thing up this new class up here you want to make sure that this public class item Table or whatever it’s called extends item because if it doesn’t extend item this here is going to be undefined so make sure that your class up here extends item then that won’t actually be read now we’re going to get on with today’s tutorial in this tutorial today We’re going to be looking at adding basic blocks so it’s almost the same as adding an item to be honest exactly the kind of like the same way we’ve got to create a variable up here we’re going to initialize it and then we’ve got to register it so it should be pretty easy For you guys to do this so let’s get started so under your item variables simply just do exactly the same thing we’re going to type public static but instead of item we’re just going to type block pretty simple then in just a lower case book and we’re going to write table Because it’s the block and then that’s the item and the highlight over block and then you want to make sure you import the right one there is a lot here so you want to make sure you click on import block and it says net minecraft block there so click that now what you Want to do is move this gain register down a couple of lines because we want them to be at the bottom and then under the item table initialization or initialization bit here what you want to do is type in block table or whatever you’ve called it and then we’ll do Equals new block table and two brackets on the end semicolon then you want to highlight over block table and click create class block table press finish now you’ll notice that it has a red line under the disk class name here you want to we’re gonna add constructor and then Just change this hit bit here where it says pi/4 i four five nine whatever it is they’re just two material and then you want to change the word inside of that super bit there to material like that just to make it a lot easy if you guys to understand because that that’s Actually obfuscated code and practically obfuscated code makes it so it’s a lot harder to read that’s what minecraft does it obfuscates their code and it’s almost impossible to read on this you d compile it and remap all the variables and class names and all that stuff like that so i just Change that parameter there parameter name there too material and come back to our mod class and what we’ve got to do now is we’ve actually got to add a argument into this block table here so inside the brackets i’m going to type in material and then you want to choose the Material that you want so you’ve got a lot of choices here so air anvil cactus cake carpet practically what this does is it will set the stepping sound and it will step it will set the break time of the I know it waits at the break time it Will set the stepping sound and the sound that it makes when you actually break it see if we did cloth you’ll notice that it it when when I break it in-game it will sound like I’m breaking a bit of will a block of wool now again we’ve got To do this set on local last name for the block so you set um oh it’s not set let’s set block name now my bad set block name and then type in block table or whatever you’re going to call it and then under the game registry register Item we want to do that again so game registry but register block this time and then copy your block variable into the first argument and then for the second one you want to put in the argument then you want to do get unlike last name then substring five I think it’s substring five just make sure that’s correct by copying that bit there and I’m just going to create a system dot out dot print Ln open bracket and then paste that bit in there and then that will print out that string now we can actually run our game now so Simply go ahead press run at the top here and then we’ll do exactly the same thing that we did before now I’m just going to quit off fraps just because it’s going to get in the way quit fraps there we go so what you’re going to do is do fluid slash give space As press tab once space tutorial mode or whatever your mod ideas two dots then press tab then press it again and then you should go over to block table press enter and you’ll see that we’ve got a block now see it’s just a pink and black checkered texture that’s just by default So what we’re going to do now is we’re going to add a name to the block and then we’re going to add a texture so let’s do that now so close off minecraft and then you want to go into your en dot US lang file again and then just create two spaces Down and then you want to type in block actually let’s check the name down the bottom here that got printed out it would have been up a little bit further it looks like it did it right so you see it printed up block table so you want to Do block dot and then grab the block name here so I copy that paste that in and do dot name equals and we’ll just call it table now we will load up the game and it should give our name that we defined here to that block now all right My bad we did it wrong it’s supposed to be tiled up block name name so let’s fix that up real quickly so in sort of block at the front here right tile and then press save and then I’ll place a flanker after real quickly run your Game again and you can now notice that the name of our block here is called table now we’re going to add a texture to it so again it’s very simple and it’s exactly like the item so we’ll go into paint.net create a texture so again you Need to a new 16 by 16 pixel document zoom in make it transparent first and then design your textures on top now this is not going to be anything fancy I’m going to create a nice red block and then what we might do is let’s see what Effects I’ve got up here can we do anything that might be somewhat of useful Signet that’s kind of cool okay that’s do you saying like this mm-hmm is that in the center doesn’t look like it’s in the center maybe we’ll move off to a it’s better needs to be a slight Weight again put that in there and then we should get a cool kind of like okay that’d be a cool little texture so go ahead file save as you don’t have to do that you can do whatever you want and if you’re still doing this from the last Tutorial you should still be in this items folder that we created for the textures what you want to do is go back and we get to see the items folder create a new folder in here and call this one blocks and inside of there save your texture so we’re just going to Call this one block table PNG make sure it’s a PNG file click Save save close off paint or neck well I don’t need anymore and then we’re just going to check that some resources over here so it should be in yet before we do this what I want you Guys to do is go up to here click View menu get a package presentation and click on this one here it will just make it a whole lot easier to look at because the other version is just horrible and it’s a bit hard to show an example because I don’t really have many Packages but it’s just a lot more yeah just it’s just horrible just put it as that see if we have a look in textures and we got blocks here we see we’ve got block table now get it back to tutorial or the main class here and then after The set block name here do dot set texture right what does its it set block texture name it’s a little bit different for the block but it’s essentially the same so you type in your mod ID and two dots and then type in block table and Then there we go that should be it now I’ll just leave that up there for a little second for you guys to see all the code just to make sure that you’ve got it all correct and now we’re going to run the game and you’ll notice now That we’ve got our texture and our block so that is quite all so that’s pretty cool just a simple texture I thought I would create so yeah that’s pretty cool so we got our block and we’ve got our table item so this is just basic item and a Basic block we’re actually going to get further into items and more advanced blocks in the future our next tutorial is going to be about food so make sure you stick around for that and this is actually going to end off this episode today as well but we’ll do a quick brief Overview again so to start a block you need to create a variable up here using the block before instead of the item here the block and then you block name variable end off with a semicolon then you need a little eyes it as stated here so equals new block table create that New class which you’ve got up here and then you want to make sure you import will create that constructor there go back into the mud class here set the block name set the block texture and make sure you put in the material inside these brackets here you want to Register the block by putting the variable in there then for the second one put block table duck down like last name and substring it by five and we can also just get rid of that we don’t need that anymore so hopefully you learnt how to do a Block today if you have any troubles make sure you pause the video read watch it and stuff people have been complaining to me or saying in the comments that are you going too fast but it’s just I don’t need to wait it I don’t want to make the tutorial 20 Minutes long when it could be 12 minutes and you could pause it it’s that easy just click the pause button guys and so this is going to end off this tutorial today hopefully enjoyed and I’ll see if the next tutorial where we’re going to be working on adding food into the game So I’ll see you guys the next one but make sure you leave like – bye Video Information
This video, titled ‘Minecraft 1.7: Modding Tutorial – Episode 4 – Basic Block!’, was uploaded by MrCrayfish on 2014-07-14 15:45:31. It has garnered 44816 views and 844 likes. The duration of the video is 00:12:00 or 720 seconds.
Hit that like button if you are keen for the next episode!
Paint.NET: http://www.getpaint.net/
Basic Java Tutorials: https://buckysroom.org/videos.php?cat=31&video=17969
Hey guys, today we start a highly requested series and this is modding tutorials. In this episode today, I teach you how to code in basic blocks to the game. This is the first step to what will become a useful block. If you are enjoying this series, please remember to hit the like button, comment and subscribe!
★ Cray’s Social Media Links ★ ● Facebook: https://www.facebook.com/MrCrayfish ● Twitter: https://twitter.com/MrCraayfish ● Instagram: http://instagram.com/mrcraayfish ● MinecraftForums: http://www.minecraftforum.net/user/596140-mr-crayfish/ ● PlanetMinecraft: http://www.planetminecraft.com/member/mr_crayfish/
★ Sponsors ★ Looking for an affordable but good performing Minecraft server? Check out PickleHosting and use the code “CRAYFISH” to get 20% off your first month! https://billing.picklehosting.com/aff.php?aff=421
Want a Gaming PC but not sure what parts to select or not confident in building it? Try PheonixPCs. They offer pre-built Gaming PCs so you dont have to worry about setting it up. Use the code “CRAYFISH” to get free shipping! http://www.phoenixpcs.com.au/