To correctly learn JavaScript please do not copy any of my code shown in this tutorial. Thank you and enjoy!
Note: For your convenience please use the java editor Notepad++
Hey guys i am a mod developer and i was a bit bored with writing script and decided that i wanted to help some people that were having trouble with blocks because there are no tutorials that only say how to simple make a block :smile.gif:.
To get this started i want to say i do not own minecraft.
Now that the legal stuff is done lets get started.
By now you should have MCP set up if you don't know how to do this you can look it up because it is fairly easy.
First Things First
Inside of MCP run decompile.bat.
Let it run until it gives you the message:
Press any key to continue. . . .
Then press any key (Obviously)
Getting Ready for Coding
Now you can open up any IDE you want and that you are most comfortable with.(Preferably Notepad++)
(Notice: If you have no clue what IDE means moding is not for you.)
Make a new .class file and name it BlockPlastic.
Now inside of MCP go into src, minecraft, net , src, then you will have a ton of .java files.
Scroll down until you find the files "Block.java" and "CratingManager.java".
Open these in Notepad++ also.
Now we are ready to start coding!
Here comes the hard part: Code
Constructing the block class.
Now you want to hop back into the file BlockPlastic.
Inside it should say something similar to:
public class BlockPlastic{
}
You will now want to delete all the words in the file.
Now we will start to make the block.
On the first line you want to write this:
pacakge net.minecraft.src;
public class BlockPlastic extends Block{
That is telling the class that this class is going to be a block now you want to type this under that:
package net.minecraft.src;
public class BlockPlastic extends Block
{
public BlockPlastic(int i, int j)
{
}
So the int means integer. If you are good at math you know what that means. This tells the game that we are going to define an integer further in the class.
So now we have the block and integer ready to be defined we can now finish the rest of the class:
package net.minecraft.src;
public class BlockPlastic extends Block
{
public BlockPlastic(int i, int j)
{
super (i , j , Material.glass);
}
}
So now super means that this is what controls the class.
Now we are defining the integer there as the material glass.
There is a lot more materials but for this tutorial this is what we are going to use.
Making the Block available in the game.
Now find the Block.java and go into the file.
Inside there will be a lot of code but there will be one thing we'll concentrate on : The initiations and definitions.
There will be a lot of declarations that look like this:
public static final Block stone;
Now you want to make one in the midst and it should look like this:
public static final Block plastic;
Now to initialize the block so the block has some unique features! Hang on we're almost done!
Giving the block features.
So now you want to go all the way to the bottom of Block.java and there will be a ton of long strings of code.
You want to add one looking like this:
plastic = (new BlockPlastic (100 , 101)).setHardness(5.0F).setStepSound(soundGlassFootstep).setResistance(10.0F).setLightValue(1.0F).setBlockName("plastic");
So this is what the game will use to determine 1. How hard the block is. 2. The footstep sound you make. 3. The damage the block gets from explosions like tnt and creepers >:smile.gif:. 4. The light amount it gives off.5. The Blocks name. 6. The block id.
If you want you can change these around the way you want because now this block has almost the same characteristics of stone.
If you want you can leave now but if you want a craft able block read on!
Making a Recipe.
Now you can go into CraftingManager.
This will be a very quick part!!!
There will be a bunch of recipes this is a basic one that you can make and paste right into the middle of the other declerations.
So this will make a recipe for block that looks like this
And every time you craft you get 4 blocks. Thank You!
Finally Finishing
Now that the code is done save the 3 files to the desktop.
Then you want to drag those back into src, minecraft, net, src and replace whatever is there.
Now recompile and reobfuscate.
The newly edited files of your block/mod should now be in the reobf file inside of MCP.
:smile.gif:.
Making a Custom Mob
I was asked to make a mob tutorial by a friend and i guess here goes nothing.....
Getting Ready
First you want to have your jars decompiled(Freshly)
Then you want to open a fresh notepad++ document and name it EntityCrazyCow.java
Now you are ready to start coding read on for the rest of the tutorial.
Starting Code
Now you want to go into the EntityCrazyCow and type this out:
This is giving the game the characteristics of the animal: Its death sound, Its living sound, and its hurt sound.
It also tells the game what to give you when you kill it which for us will be and iron ingot.
Now that the Crazy cow is in the game we need to give it a look read on for the model!!
Making The Model Class
Now that we have the Entity we need to know the dimensions of the cows body, Right? Yes we do!
Make a .Java called ModelCrazyCow
Now (Depending on the animal your making) you type this:
This bit of code tells the game what the cow will look like in the game depending on the animal your making the variables will be different but for the cow these seem just about right.
Now for making the cow spawn go on with the tutorial!
Making The Cow Available For Spawning
Last but not least make a .java called RenderCrazyCow
This code will show the game that we want this animal to spawn in the world.
Write this bit of code in the .java:
This tells the game that we want this animal to spawn and we want you to render it when you load chunks.
Finalizing The Animal
Now we want to finalize the entity which will take no time at all!
Go into your minecraft.jar and find the mob folder.
Inside will be the mobs pictures find cow.png duplicate it and name it CrazyCow.png.
Now add your new class files to the minecraft.jar and your new mob is ready to go :smile.gif: !
Thank you for reading my tutorial please leave me a reply if this helped you and any types of questions or concerns you have with the code you can ask and i will try to help you my best.
You are very welcome :smile.gif:. I really wanted to help with my new found knowledge. Also leave me a reply if you want any other How To tutorials with coding.
There are more of this kind tutorials. This is really really basic, you can't do anything with it. Maybe at least give instructions for a custom texture.
Almost everything you say is true, except for this line:
It's not, actually. It's the resistance to explosions (tnt, creeper, ghast).
Oh, and nice picture you got there
Thanks for the compliment and i know now i was trying to do this very quick 20 minutes ago. This tutorial is a bit different because i think i show how to make a block without all of the extra B.S. that nobody wants to read. Sorry but i think this is a bit unique :smile.gif:.
Thanks for the tutorial I really like this one cause it doesn't have the B.S. That I don't care about.
But one question how can I make a mob spawn on certain blocks or with certain light levels.
And I would also like a more in depth tutorial on how to make the mob model, and maybe do put some of the boring B.S. In it so I can undrstand it better.
Thanks for the tutorial I really like this one cause it doesn't have the B.S. That I don't care about.
But one question how can I make a mob spawn on certain blocks or with certain light levels.
And I would also like a more in depth tutorial on how to make the mob model, and maybe do put some of the boring B.S. In it so I can undrstand it better.
So the model is self explanatory.. You need to learn the coordinates of the image and then you can just fill in what was there to what you want. Or you can use what is there to maybe "Re-Shape" the mob that you want because that will allow you to make it proportional.
Note: For your convenience please use the java editor Notepad++
Hey guys i am a mod developer and i was a bit bored with writing script and decided that i wanted to help some people that were having trouble with blocks because there are no tutorials that only say how to simple make a block :smile.gif:.
To get this started i want to say i do not own minecraft.
Now that the legal stuff is done lets get started.
By now you should have MCP set up if you don't know how to do this you can look it up because it is fairly easy.
First Things First
Inside of MCP run decompile.bat.
Let it run until it gives you the message:
Then press any key (Obviously)
Getting Ready for Coding
Now you can open up any IDE you want and that you are most comfortable with.(Preferably Notepad++)
(Notice: If you have no clue what IDE means moding is not for you.)
Make a new .class file and name it BlockPlastic.
Now inside of MCP go into src, minecraft, net , src, then you will have a ton of .java files.
Scroll down until you find the files "Block.java" and "CratingManager.java".
Open these in Notepad++ also.
Now we are ready to start coding!
Here comes the hard part: Code
Constructing the block class.
Now you want to hop back into the file BlockPlastic.
Inside it should say something similar to:
You will now want to delete all the words in the file.
Now we will start to make the block.
On the first line you want to write this:
That is telling the class that this class is going to be a block now you want to type this under that:
So the int means integer. If you are good at math you know what that means. This tells the game that we are going to define an integer further in the class.
So now we have the block and integer ready to be defined we can now finish the rest of the class:
So now super means that this is what controls the class.
Now we are defining the integer there as the material glass.
There is a lot more materials but for this tutorial this is what we are going to use.
Making the Block available in the game.
Now find the Block.java and go into the file.
Inside there will be a lot of code but there will be one thing we'll concentrate on : The initiations and definitions.
There will be a lot of declarations that look like this:
Now you want to make one in the midst and it should look like this:
Now to initialize the block so the block has some unique features! Hang on we're almost done!
Giving the block features.
So now you want to go all the way to the bottom of Block.java and there will be a ton of long strings of code.
You want to add one looking like this:
So this is what the game will use to determine 1. How hard the block is. 2. The footstep sound you make. 3. The damage the block gets from explosions like tnt and creepers >:smile.gif:. 4. The light amount it gives off.5. The Blocks name. 6. The block id.
If you want you can change these around the way you want because now this block has almost the same characteristics of stone.
If you want you can leave now but if you want a craft able block read on!
Making a Recipe.
Now you can go into CraftingManager.
This will be a very quick part!!!
There will be a bunch of recipes this is a basic one that you can make and paste right into the middle of the other declerations.
So this will make a recipe for block that looks like this
And every time you craft you get 4 blocks.
Thank You!
Finally Finishing
Now that the code is done save the 3 files to the desktop.
Then you want to drag those back into src, minecraft, net, src and replace whatever is there.
Now recompile and reobfuscate.
The newly edited files of your block/mod should now be in the reobf file inside of MCP.
:smile.gif:.
Making a Custom Mob
I was asked to make a mob tutorial by a friend and i guess here goes nothing.....
Getting Ready
First you want to have your jars decompiled(Freshly)
Then you want to open a fresh notepad++ document and name it EntityCrazyCow.java
Now you are ready to start coding read on for the rest of the tutorial.
Starting Code
Now you want to go into the EntityCrazyCow and type this out:
This is giving the game the characteristics of the animal: Its death sound, Its living sound, and its hurt sound.
It also tells the game what to give you when you kill it which for us will be and iron ingot.
Now that the Crazy cow is in the game we need to give it a look read on for the model!!
Making The Model Class
Now that we have the Entity we need to know the dimensions of the cows body, Right? Yes we do!
Make a .Java called ModelCrazyCow
Now (Depending on the animal your making) you type this:
This bit of code tells the game what the cow will look like in the game depending on the animal your making the variables will be different but for the cow these seem just about right.
Now for making the cow spawn go on with the tutorial!
Making The Cow Available For Spawning
Last but not least make a .java called RenderCrazyCow
This code will show the game that we want this animal to spawn in the world.
Write this bit of code in the .java:
This tells the game that we want this animal to spawn and we want you to render it when you load chunks.
Finalizing The Animal
Now we want to finalize the entity which will take no time at all!
Go into your minecraft.jar and find the mob folder.
Inside will be the mobs pictures find cow.png duplicate it and name it CrazyCow.png.
Now add your new class files to the minecraft.jar and your new mob is ready to go :smile.gif: !
Thank you for reading my tutorial please leave me a reply if this helped you and any types of questions or concerns you have with the code you can ask and i will try to help you my best.
Happy Modding Guys!!!
And FIRST!
You are very welcome :smile.gif:. I really wanted to help with my new found knowledge. Also leave me a reply if you want any other How To tutorials with coding.
Thanks for the compliment and i know now i was trying to do this very quick 20 minutes ago. This tutorial is a bit different because i think i show how to make a block without all of the extra B.S. that nobody wants to read. Sorry but i think this is a bit unique :smile.gif:.
No probelm and thanks for the feeback :smile.gif:.
Great im glad it did and im excited to see what new blocks you make :smile.gif:.
Your error is because you didnt put the files into your src.
The rendercrazycow should be in lowercase.
Where is says this:
And here...
You said crazy twice:
But one question how can I make a mob spawn on certain blocks or with certain light levels.
And I would also like a more in depth tutorial on how to make the mob model, and maybe do put some of the boring B.S. In it so I can undrstand it better.
Yea you'll have to do the texture to make sure you're not passing it because it is white :smile.gif:.
So the model is self explanatory.. You need to learn the coordinates of the image and then you can just fill in what was there to what you want. Or you can use what is there to maybe "Re-Shape" the mob that you want because that will allow you to make it proportional.