All right guys welcome back to another one of my forge 1.6.4 minecraft modding tutorials and we’re going to make a blog and have a blog in the game custom blog that we’re going to make uh by the end of this tutorial so let’s get this started now First thing we’re going to need to do is define a variable so i’m going to go ahead and grab some of this code over um and we’re going to define a variable so all your variables you’re going to put you know at the top you know just below Your public class it’s going to help organize your code a little bit we’re going to make it a type of public static so this is a variable how you define a variable here so we’re going to make it a block and we’re going to actually import a net minecraft blog So say for example you accidentally imported the wrong one let’s say you imported calm jcraft jarvis uh it’ll fix the error but you know your code might not work so you know make sure you’re importing the right thing so if you do something like this go ahead and find the import That you accidentally imported and erase it and then go ahead and import the correct one so we’re going to be importing block from net minecraft blog because that is the class we’re going to be using so we’re importing the block class from minecraft.net um and we’re gonna make a variable so Basically um we’re making a variable and it’s the type of block and we’re gonna call it block one so you can call block one whatever you want uh for the sake of this video i would recommend you know following along and calling it block one it’ll make things a lot easier if you Know if you just follow along with these uh kind of kind of thing so i’m not going to get into you know how every little thing works in java programming um you know you could spend 20 minutes a half an hour just explaining what a variable is you know So i’m not going to really get into explaining everything so understand though we do need a variable to uh to create something so now that we got that out of the way i’m actually going to move this down we’re not going to be working with this Until later on so i’m going to move this out of the way make things a lot simpler for you guys to look at and we’re going to be working basically in here our variables are going to go up here and we’re going to be working in this uh Event function class or not class function i guess you can call it over here so now that we defined a variable we’re gonna make a new class so we’re gonna call block one equals new block one like so or actually yeah like so so our new class is gonna be called Block one so if you named your variable uh stone you would say equals new stone um you know make sure you capitalize this as it’s going to be an identifier for you so we’re going to create the class of block one so go ahead and select here whatever your class is Called whatever you named it if you’re following along great great class block one and select finish and it created a new class for us so if we look over my package we got a main class and now we have a block one class few things something might have happened here You might have had uh it look like this so make sure you write extends block in there as well as your error might look like this so you will have to import uh net minecraft block again and then we’re gonna have this error here well it’s not really errors you know a Lot of imports um basically code hinting you know helping you to code so we’re gonna add the constructor for this which will set it all up and you know we don’t really have to worry about this we got a new class it’s set up everything in here control s save it the keyboard And we can just close this off get rid of it everything’s set up in there for now go back to your main and we got some errors here uh that we gotta correct so every time we make a new block so this is going to be calling our class There’s two things in here that it looks for so it actually looks for an integer and the material type so the integer is the data value so we can name whatever number we want in here so say for example we named it five five is being taken by minecraft Data values so if you typed in on weak on the internet you know minecraft data values you’ll get a page that you know represents all the blocks to the data values i’m sure a lot of you guys know what data values are what so you know wall is 35 and you know Torches or 50 or something like that you know been a long time since i’ve kind of played minecraft here i used to know them all off by heart so we’re going to name it 3 000 because 3 000 isn’t being taken um don’t go too high of a number Uh and don’t go too low so just stick with 3 000 you know stick with me and you know everything will be working correctly now we’re going to give it a material so basically a material is is not a texture material is maybe a lowercase material don’t let’s maybe i gotta Finish this off material dot let’s go rock okay it was with uppercase i didn’t have to import this okay apparently is it already imported i’m gonna actually okay well if you do need to import it import it there material.material so highlight it and import it so the material.rock is it’s basically Inheriting your block is going to inherit properties from the rock i’m not sure what properties it’s all going to inherit it’s not going to inherit the texture it’s going to inherit certain properties so we could go like a dot error and we can make it inherit certain properties from error or whatever Select which one you wanted to inherit you know play around i’ll just you know select cloth here for example and we’re going to inherit some properties from cloth so i’m going to go back over here and actually i’m going to copy a bunch of code in here Makes certain things a little easier so i can go through this with you guys so i don’t have to type every little thing out and i will comment out some of the stuff here that we don’t really need just yet okay all right so um you don’t have to worry about you Know adding all these uh things and comments and stuff that i have go ahead define your blog um give it a number a material type and then we’re gonna set an unlocalized name remember all these green things are in common um it’s it’s commented oh it’s not part of the code So we’re going to set a unlocalized name and we’re going to give it the name of block 1 which is going to be the same name as our variables you know i like to keep my variable names the same as my unlocalized name so an unlocalized name is basically a non-human readable name Next thing we’re going to need to do is register the block with minecraft so that it’ll actually be in the game so we can go ahead and import game registry cpw mods fml comment registry import that and we should have everything for our blog so ctrl s save that And we should be able to go and get our block in the game so let’s go ahead and let’s test this let’s run you know highlight it make sure clients selected and and you know there’s a bunch of different ways you could write this out but you know this is the basic stuff That you need to create a block now you’re not gonna have a texture yet we’re gonna have to make a texture certain things like that which we’re gonna get into where’s my minecraft i’m recording so let’s take a little bit more here we go so go to single player Uh create a new world we’re gonna put it into creative and that’s good make sure you’re in creative because we’re gonna need to be using cheats alright so here we are in the game and i am lagging that’s because i am recording honestly hopefully okay so If we look in here our block isn’t going to be in creative mode yet we’re going to get it into creative mode but we can give ourselves the blog so slash give press tab to get your username and then your id so i named uh the id of 3000 you might have gave Yours a different id so so we just got our first you know block right there awesome it’s not textured but here it is so this is the default minecraft texture which we’re gonna have to give it our own texture right away so we’ll close this off that’s fine So we got our block um once again you know if your minecraft didn’t load that’s probably because you uh tried to pick in a different number here so we don’t name it something correctly uh you could have wrote this out differently you you put it up here like that I’m just you know spacing it down below so it’s you know not all one line so you guys can actually see what’s going on see this little um comma here at the end that closes um closes you know java so if i put that up there and then put that here You know that’ll close that line so you might see me playing around with these and wondering what the hell i’m doing so basically this closes the line so let’s move on to the next step here what else let’s put it into creative tab so i’m just going to open up this and Once again we’ll import this creative tabs on net minecraft creative tab import that and set creative tab i’m gonna take away that and it’s gonna carry on here so it’s gonna read like this is all one line so like i said you know you could write it like this for example And you know comment this out like that but just you know for the sake of this video so you can see i’m going to leave it like this and you could write your code like this too you know you don’t have to have all these in between you could have it You know like that you know it’ll look nice like that but i’m giving you guys code hints and stuff in here hope it’s not throwing you off okay so now we set the creative tab and we give it a creative tab of tab block so we could change the tab So if we just you know erase the dot for example and then hit dot period it’ll bring up the creative tab and all our options so you know we could have the food tab our blog will go to the food tab for example or the tab block tab Uh we are making a blog so let’s have it go to the blog tab so you know select it it’s going to go to top block control s on the keyboard to save it and run it and test it and we’ll see that in fact our block is now in the creative tab After minecraft loads here here we go we’re in the game go back in there and you know wherever you put your tab it should be in there let’s see block we’ll scroll down and there it is now if you look at it it’s same tile dot block one dot name So that’s not really a good name for it we actually have to give it a human readable name so that’ll be the next part here that we’re gonna get into uh the next part here so right here define a human readable name so i’m just going to uncomment this And we’re going to write you know language registry.add name block one which is the un readable name from our game registry and we’re going to name it whatever we want so you can name it whatever you want um i’m just going to call it my first block we’ll import this import the language Registry and then our block will now be called whatever you want to call it some other things we could do here we could set the harvest harvestability of the block for example so we’ll import this as well so we can make it harvestable with a pickaxe you know you need a pickaxe and I believe the three will represent a diamond you can play around with these variables here so you can change this to two for example or one i’m not quite sure which number represents which so go ahead and you know play with that so you’ll have to put yourself into survival and you know To test this line of code and see what harvest level the block needs so this is you know good for now we got everything set up now all we need is a texture so save everything and let’s work on a texture so i’d recommend for you guys uh what you guys should do Go on the internet download a texture pack any texture pack or resource pack out there and get some textures um just for the sake sake of these videos so you don’t have to keep on making textures because you know making textures isn’t really learning to code but i will show You how to make a texture um first of all your textures are going to go into source main resources assets my molg textures and it’s going to go into blogs so i actually have you know some textures in there um so let’s go ahead for the sake of this video uh we’ll We’ll make our own texture like i said you know for you guys save you guys time uh go ahead and download a texture pack so you don’t have to be making a new texture every time we’re making a new tutorial so i got paint.net any paint program will work for this tutorial You might have gimp’s free paint.nets free microsoft paint is even you know usable it’s a little bit harder to use uh and you also have to manually save it as a png afterwards so if you got paint on it awesome if you don’t you know try to follow along So we’ll go file new and we can select whatever type of a multiple of 16 so you could have it 16 by 16 or you could have a 32 by 32 you know 256 by 256 whatever how big you want to make it uh the texture size it’s up to you i’m Not sure if there’s a maximum cut off i’m sure there is uh but yeah so make sure your width is the same as your height though so press ok if if it’s not your texture pack or your texture isn’t the same i believe you might run into problems so i’m just Going to go ahead and make it 16 by 16 this way it’s less to draw and press ok uh control plus on my keyboard to zoom in i’m gonna select a rectangle tool wipe off all this and you know we could you could paint it whatever you want to paint I’m just gonna fill it in with let’s go with like blue or some like that let’s go with yeah let’s go with blue so this is fine you can you know get into painting yourself something that’s awesome i’m not gonna do that so i’m just you know going giving you through the Process here so go save as and i will call this um block 33 just because i’m not sure what to call it and i’ll save it to my desktop auto detect this is fine and it’s to my desktop i’m gonna close this all off now So there it is i’m going to put it inside to here and with my other textures like i said you know same on the folders we already created all these folders you guys might be wondering where is these block folders seen my last video where we set up these folders So inside here you know like i said go grab some textures so you can play around well you know don’t use them in your actual mods that you’re going to release you know for testing purposes that’s fine so we called it block 33 you know it might matter if you have a Capitalization in here so don’t have a capitalization in here you know don’t have a space in here no stick to proper naming conventions we’re going to call block 33 i named it you can name yours whatever you want name it we’re gonna go back to the next part of The code which is setting the texture so we can actually set the texture i’m gonna actually just move this down here or you know it’s whatever is fine and we’ll set the texture down here so it’ll be the last thing that we do and we’ll close that off i believe that’s a semicolon Or a normal one i’m not sure so here we are gonna do the set texture name and we’re gonna go my moid so your my moid is whatever you named it up here so if you named it something different you put that in there that’s your first representative identifier here your next identifier Is the name of your actual textures so i said i named mineblock33 so that’s going to be block 33 there so whatever you named it you name it there so i’m going to control s on the keyboard to save it and now it’s going to have the texture of block 33 here I hope you guys are following along let’s run the client and we are going to have the block in the game guys i hope you are excited as i am and there it is all our blocks are now blue and we never looked at the name but There it is my first block is also the name we never really checked that change but there it is and you know like i said you know put yourself in survival play around test the harvest ability um so you know it could read all like this for example so just to make things Easier for you guys to read all this you know this is a good way to write it all out like so and then have it close with this so and then you have your harvestability like the so and then your you know register your blog and then give it a name So we did all this kind of stuff and here’s you know where you change your name again so if you want to make another blog very simple we simply create another variable and we’ll go like this and this time we’ll call it block two like so So we got block one now we’re gonna call block two and i’ll just go ahead and copy and paste some code over here i’ll use you know this as an identifier you know to break up my code copy this whole line over and i’ll paste it down here And actually just get rid of this so you guys can see a little bit better and we’ll name so block one we’re gonna change this to block two now because we have a new variable for it so it’s now gonna take on block two so block two equals we’ll Do block one we don’t have to generate a new class if we don’t want to uh you can go ahead and you know make a new block two class if you want that’s awesome if you do if not that’s fine we can use block one class and we’ll give It another data value because 3000 is taken so we’ll make it 3001 as our new data value uh you know you can change it to the material type you want now set unlocalized name well set the unlocality’s name to block two and also give it the texture of block Two because i have a block two right here set up and i’ll actually give block one a different texture as well so because i have you know a block one texture and a block so block one having block one texture block two’s having block two texture excuse me and We’ll change this here you know basically changing everything from one block one to block two on my first block is not going to be my second block while they’re changing that spelling mistake so block one now there’s even another easy way to do this if you Press ctrl f on your keyboard you know you can find everything that says block one for example and have it replaced with everything that says of block two and you know make it case sensitive so it doesn’t replace your classes or whatever and you could you know auto do Everything like that so that’s a little tip there so let’s go ahead and test this out everything should be you know block one we’re gonna use that same class if you did not want to do that and you want to go like that that’s fine you know just Create a new class for it and uh you know do the same steps that you did to make that a last class this is fine let’s test this out this out run it all right so we should have our new texture on block one there it is right there and our Block two should also be in here my second block right here so we got you know whatever textures you used and you got you know your two blocks so you can now uh do slash give again slash give tab 3001 you know to get more of these blocks Down because we have another data value for that as well so i think that wraps up this tutorial guys you know you could go ahead and make um a thousand blogs uh give them all new textures very simple you don’t even have to make a new class like i said just keep on Copy and pasting change block two to block three um you know change the name and go ahead and do that you know make you know worth five more blocks for the next uh before you go into the next tutorial maybe or you know get set up Figure that out alright and i’ll see you in the next video Video Information
This video, titled ‘Minecraft Forge 1.6.4 Modding Tutorial Custom Blocks p3’, was uploaded by PersistentPixels on 2015-06-17 23:41:15. It has garnered 215 views and 2 likes. The duration of the video is 00:25:39 or 1539 seconds.
Minecraft Forge 1.6.4 Modding Tutorial Custom Blocks p3, how to mod minecraft forge 1.6.4, forge custom block tutorial