Failure in this will result in total failure. A tutorial on how to do these basic things will be posted in later days. Modding Minecraft is EASY for beginners. You just gotta' know how!
Basically I would simplify this, but seeming like this is the only tutorial out there that I know of that gives info on this subject, I'll over-explain - let's begin! You can use any IDE you want.
How To Make A Block
First of all, blocks are just another cube with a texture. The functions that indicate what they do can be coded know minecraft's jar content.
Go ahead and open (MCP>src>minecraft>net>minecraft>src) (Going to be called java path)
Once your in java path, go ahead and find the file called 'Block.java'
This holds all the block types in-game and what attributes they have.
You will find a line like:
public static final Block stone = (new BlockStone(1)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stone");
I will explain this whole line.
Creating a variable called stone that is a instance of Block family, We create new BlockStone(1).
Meaning, We create a block of stone.
Looking at:
Block stone = (new BlockStone(1))
We are creating a block of stone. The 1 inside of the () states the BLOCKID.
This is important when you want to create a block no-one else creates.
This is the format for a block. Get used to it.
The .setHardness(1.5F) defines the breaking speed on a block.
Adding onto that we can set the Resistance via .setResistance() for resistance against explosives.
.setStepSound(soundStoneFootstep) explains it'self.
Now pay attentions to .setUnlocalized name! This is your in-script identifier.
They called it simply stone. I called my block Naegro Speed Block.
Let's add a example block.
public static final Block example = (new BlockExample(500)).setUnlocalizedName("Example");
Simples. But we are not done.
Go ahead and search for the file named BlockStone.java
Inside you will see:
package net.minecraft.src;
import java.util.Random;
public class BlockStone extends Block
{
public BlockStone(int par1)
{
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
}
This defines what the block does and is. You can change the material, but only if you look at Material.java for reference, for there are blocks with certain attributes.
When you see the set creative tab, that is just where it belongs. You can find the different tab names in CreativeTabs.java.
Looking at the idDropper, this is what drops when you break the block. It will return back cobblestone, unlike in some scripts, you must define what drops in this case. I can make it drop diamond ores. But thats not what we are going at. Find another script and look at the idDropped() and you will see nothing on most. The good thing is default is it's-self being dropped.
Ok so let me show you how to make my example block!
I make a new text file and name it BlockExample.java
I then put this code into it.
package net.minecraft.src;
import java.util.Random;
public class BlockExample extends Block
{
public BlockExample(int par1)
{
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
}
Done! We have a block. If recompiled and tested, in creative mode, you can place you block.
BUT WHAT'S THIS?! NO TEXTURE? Easy. Go inside the minecraft.jar file. Go in texture>block and take
a block out of there (it's 16x16 pixels can't miss it!)
Edit it to your liking and name it what you set your unlocalized name to.
As if you search for the stone block inside the jar, it is stone.png.
SAVE IT AS PNG. Just sayin'.
Bingo a textured block!
How to make an Item
Here we will learn to make an item. We can put this into crafting and everything! (same with blocks)
Go ahead and go to your java path(source as stated in block tut)
Find the file called item.java
You will find a line that looks simular to:
public static Item arrow = (new Item(6)).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat);
Explaining this, We create a new Item how we create a block.
We must give it a data type of Item.
.setUnlocalizedName("arrow") Pay attention to this. This is what your block will be recognized as (texture wize)
.setCreativeTab() Explains it'self. This item is put into the tab Combat. (More info on tabs in CreativeTabs.java)
Wallah! We have a new Item. But we are not done. No not at all!
You will need to make a java file especially for it, unless it has actual functionality. Arrow does NOTHING, bow does SOMETHING with ARROW. That being there is no .java file for arrow. You need to know more about java coding in order to do stuff with it. Like instantiating blocks on click (Like a random block). Functions can be taken out of a file and linked in your new one.
Adding Names to Blocks/items
This is VERY EASY! This literally took me 3 days to find out how to do with the poor current community.
Once your all done with your items and swords and what not, you go into
your root MCP folder (Just the MPC folder) and go to (temp>bin>minecraft>lang)
Take out en_us.lang. and open with notepad++ (Doing in regular notepad breaks the .lang file)
Further down you will see (after options)
tile.word.name=Name Here
To add a block name, you put this code with edits of course.
My example block would be like this:
tile.example.name=Example Block
Keep in mind the unlocalized name is used!
Scrolling down more you will see the same kind of set.
Except this is for items. Do the exact same thing!
item.exampleItem.name=Example Item
Adding Crafting Recipes For Items
This little tutorial will explain the crafting manager.
This tutorial is only for items (apples, arrows, blocks, etc.) right now.
Swords, pickaxes, shovels, hoes, will all not be included yet.
Go ahead and go to java path.
When you get there search for and open CraftManager.java
When you open the java file and scroll down a bit, you will get a line like:
this.addRecipe(new ItemStack(Block.snow, 6), new Object[] {"###", '#', Block.blockSnow});
You just simply fill in the things you need. I will make a example item.
Please keep note that BLOCKIDNUMBER has to be a unique ID NUMBER.
To make example block, you need to make a 'bowl' out of cobblestone instead
of planks.
this.addRecipe(new ItemStack(Block.Example, 1234), new Object[] {"X X", " X ", 'X', Block.cobblestone});
Let me explain the X's.
There is this line:
{"XXX", "XXX", "XXX", 'X', Block.BlockType}
See how there is only 3 rows of 3 X's? This is the crafting table!
The first 3 X's would state that the person should put the block
BlockType into all of the slots on top row. Same for middle and
bottom row. We can even do this if we wanted to make it not
requiring a full crafting table of BlockTypes.
{"XXX", "XXX", 'X', Block.BlockType}
Now it doesn't matter if I fill the top and middle, or bottom and middle
rows. It would still make whatever comes out of BlockType.
Notice how I have spaces? This specifically dictates where blocks CANNOT
be placed inside of your recipie.
Something like the bow (Does not go in CraftingManager. Don't try.)
Let's restate this correctly to make a real X recipe!
Please note you need to make a block called X inside of block.java
and make another .java file for it to define it. (See above tuts)
this.addRecipe(new ItemStack(Block.X, 1234), new Object[] {"X X", " O ", "X X", 'X', Block.planks, 'O', Block.cobblestone});
To Do: (Some tomorrow (Follow Post))
Creating A Sword
Making A Monster/Enitity
Publishing Your Mod
Any Confusions Please, Send me a message. No guarantees that I will respond due to idiots. Super simple questions will not be answered. If you feel like it is a question that needs asking, please state so with some backup reason why you don't understand. I aim to aid. There are no stupid questions. Unless they are what ifs. Those are not questions, they are things to think about.
If you want something added to this tutorial that is not added, or planned, please message me! Please do not be dumb.
I'm sorry, copying pre-made code is not and should not be a prerequisite for any sort of programming. That is about the worst way you can go about learning to code.
I'm sorry, copying pre-made code is not and should not be a prerequisite for any sort of programming. That is about the worst way you can go about learning to code.
Minecraft basically is it's own API. Please, if you do not know much don't say anything. I am telling how to use the functions and no how to code.
Minecraft basically is it's own API. Please, if you do not know much don't say anything. I am telling how to use the functions and no how to code.
They are not finished yet.
Sorry, but you're the one who doesn't know much. You're trying to tell me that editing a language file with Notepad++ is the correct way to give mod items/blocks names? Your entire approach to modding is going at it from the completely wrong angle. Try downloading MCForge and using that API and its set of tools in order to make your mod. Also, Notepad++ is the worst IDE that you can be using to develop mods. Try using something such as Eclipse. There is a reason that every notable modder uses the Forge API and a proper IDE, because it allows for easy distributing and conflict resolutions.
Sorry, but you're the one who doesn't know much. You're trying to tell me that editing a language file with Notepad++ is the correct way to give mod items/blocks names? Your entire approach to modding is going at it from the completely wrong angle. Try downloading MCForge and using that API and its set of tools in order to make your mod. Also, Notepad++ is the worst IDE that you can be using to develop mods. Try using something such as Eclipse. There is a reason that every notable modder uses the Forge API and a proper IDE, because it allows for easy distributing and conflict resolutions.
-You're trying to tell me that editing a language file with Notepad++ is the correct way to give mod items/blocks names No I never said that, I am suggesting a free software. This is not a tutorial for MCForge now is it? Notepad++ Is not the worst program to develop mods. Try notepad or try wordpad. Doesn't cut it does it? Eclipse is good too. But it requires setting up. I do not care what you use. Keep your ideas to yourself, if asked to. I stated, 'please do not be dumb' and to message me concerns.
Why would you aim to shoot down this? This is a specific tutorial for MCP ONLY. Not MCForge.
While it is okay to post tutorials on how to mod base Minecraft, most modders will NOT agree with this. Modding the base Minecraft creates many compatibility issues with other mods, and often methods of doing things are more complicated without a common API such as Minecraft Forge or ModLoader.
mwb12345 is right to suggest that Notepad++ is not a very suitable IDE to code with. Proper Java IDE's will highlight many simple issues with the code, such as if you spell a name wrong (because remember, case IS important), if you are referencing something that does not exist, etc. Eclipse also provides a method of testing your code by running Minecraft without having to recompile and reobfuscate beforehand, making it MUCH easier to test your code.
While modding base Minecraft classes with Notepad++ is possible, and is most certainly allowed, I think many people would find your tutorials more useful if you instead explained how to use Eclipse or another suitable IDE to mod with MinecraftForge or ModLoader.
While it is okay to post tutorials on how to mod base Minecraft, most modders will NOT agree with this. Modding the base Minecraft creates many compatibility issues with other mods, and often methods of doing things are more complicated without a common API such as Minecraft Forge or ModLoader.
mwb12345 is right to suggest that Notepad++ is not a very suitable IDE to code with. Proper Java IDE's will highlight many simple issues with the code, such as if you spell a name wrong (because remember, case IS important), if you are referencing something that does not exist, etc. Eclipse also provides a method of testing your code by running Minecraft without having to recompile and reobfuscate beforehand, making it MUCH easier to test your code.
While modding base Minecraft classes with Notepad++ is possible, and is most certainly allowed, I think many people would find your tutorials more useful if you instead explained how to use Eclipse or another suitable IDE to mod with MinecraftForge or ModLoader.
The choice is up to you, however.
I agree, but again. I state that 'You can use any IDE' I was going for pure BASICS.
I am currently trying to make some mods without having modloader, or any other kind of pre-made mods to create mods, and i must say that your explanations are way better than all these i have seen so far, your tutorial is short and efficient, and explain what i needed to know...
Are you going to finish the mob section etc? I know it's a pretty recent post (may 22 - 2013), but i think it's better to ask now rather than in 1 year.
There are not alot of textual tutorials and i prefer to read texts, as it's easier for me to understand.
Any update? keep up
I agree, but again. I state that 'You can use any IDE' I was going for pure BASICS.
I agree with pwnedmanmob. If I knew where most of these files were, I can do this on regular Notepad. It seems easy enough with any text program. I learned when I got mcreator that the more "easy" modding is, the more problems it has. I have seen no problems with Shape shifter Z, Too many items, or Single player commands. And they all don't need any mod loading program like forge or modloader. But I would REALLY appreciate it if you finished the last three spoilers because to make my mod I was going to add both entities and swords, and obviously I was gonna publish it, so I would appreciate it if you can finish them since so far this is the best tutorial I've seen to make mods.
I'm making an API to replace ModLoader, because it looks like it's dying. It'll load mods like forge, but with the addition of functions forge doesn't have. For instance, rotating images easily. (Just one of many) I'll take a look at your tutorials, and see what happens.
Rollback Post to RevisionRollBack
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
The Meaning of Life, the Universe, and Everything.
Location:
upyourbuttroundtheconorville
Join Date:
7/20/2013
Posts:
52
Minecraft:
DatBro64
PSN:
jonnythesmartguy
Member Details
To comlacated lol jk
Rollback Post to RevisionRollBack
Yeah I'm just Jonny from Skyler and Jonny (I bet you don't know what the hell it is) but please subscribe and I'll make a Gaming channel with Minecraft and JUST SUBSCRIBE wait Why am i still talking?
The OP wanted to show how to go about modding in a "basic" way, pretty much minimising the amount of things you need to do. Not exactly the smartest idea, and it's not exactly basic either. Either way you look at it, you still need to install stuff. Using Forge / other loaders? Just install Forge and the IDE you wish to use, learn how the Forge API works, and start modding. Not using any loaders? Install Notepad++, install MCP, install some NP++ addons that make your life easier (NP++ is not designed for Java development, it's slow, doesn't provide any tools for development by default, and in general is not for developing Java applications, IMO it's more so for quickly looking at / editing and compiling code on the fly, when it comes to Java), run decompile.bat / decompile.sh to decompile the game, learn how the Minecraft "API" works (Minecraft is not it's own API, Minecraft is just designed in such a way that abstraction is used a lot, so things are a little easier to work with), learn how to modify the Minecraft code in a cleaner and more productive and efficient way, and it goes on. All in all, using loaders alongside an IDE is quicker and easier, and more basic too.
Hello future modders of minecraft! I want to state now you will not get anywhere with modding here without some basic knowledge of these topics:
I do not take any blame for anything you do to your minecraft.jar. I am NOT out to tell you to press (ALT+F4)
Recommended Things to have:
Must Haves:
Failure in this will result in total failure. A tutorial on how to do these basic things will be posted in later days. Modding Minecraft is EASY for beginners. You just gotta' know how!
Basically I would simplify this, but seeming like this is the only tutorial out there that I know of that gives info on this subject, I'll over-explain - let's begin! You can use any IDE you want.
Once your in java path, go ahead and find the file called 'Block.java'
This holds all the block types in-game and what attributes they have.
You will find a line like:
I will explain this whole line.
Creating a variable called stone that is a instance of Block family, We create new BlockStone(1).
Meaning, We create a block of stone.
Looking at:
We are creating a block of stone. The 1 inside of the () states the BLOCKID.
This is important when you want to create a block no-one else creates.
This is the format for a block. Get used to it.
The .setHardness(1.5F) defines the breaking speed on a block.
Adding onto that we can set the Resistance via .setResistance() for resistance against explosives.
.setStepSound(soundStoneFootstep) explains it'self.
Now pay attentions to .setUnlocalized name! This is your in-script identifier.
They called it simply stone. I called my block Naegro Speed Block.
Let's add a example block.
Simples. But we are not done.
Go ahead and search for the file named BlockStone.java
Inside you will see:
This defines what the block does and is. You can change the material, but only if you look at Material.java for reference, for there are blocks with certain attributes.
When you see the set creative tab, that is just where it belongs. You can find the different tab names in CreativeTabs.java.
Looking at the idDropper, this is what drops when you break the block. It will return back cobblestone, unlike in some scripts, you must define what drops in this case. I can make it drop diamond ores. But thats not what we are going at. Find another script and look at the idDropped() and you will see nothing on most. The good thing is default is it's-self being dropped.
Ok so let me show you how to make my example block!
I make a new text file and name it BlockExample.java
I then put this code into it.
Done! We have a block. If recompiled and tested, in creative mode, you can place you block.
BUT WHAT'S THIS?! NO TEXTURE? Easy. Go inside the minecraft.jar file. Go in texture>block and take
a block out of there (it's 16x16 pixels can't miss it!)
Edit it to your liking and name it what you set your unlocalized name to.
As if you search for the stone block inside the jar, it is stone.png.
SAVE IT AS PNG. Just sayin'.
Bingo a textured block!
Go ahead and go to your java path(source as stated in block tut)
Find the file called item.java
You will find a line that looks simular to:
Explaining this, We create a new Item how we create a block.
We must give it a data type of Item.
.setUnlocalizedName("arrow") Pay attention to this. This is what your block will be recognized as (texture wize)
.setCreativeTab() Explains it'self. This item is put into the tab Combat. (More info on tabs in CreativeTabs.java)
Wallah! We have a new Item. But we are not done. No not at all!
You will need to make a java file especially for it, unless it has actual functionality. Arrow does NOTHING, bow does SOMETHING with ARROW. That being there is no .java file for arrow. You need to know more about java coding in order to do stuff with it. Like instantiating blocks on click (Like a random block). Functions can be taken out of a file and linked in your new one.
This is VERY EASY! This literally took me 3 days to find out how to do with the poor current community.
Once your all done with your items and swords and what not, you go into
your root MCP folder (Just the MPC folder) and go to (temp>bin>minecraft>lang)
Take out en_us.lang. and open with notepad++ (Doing in regular notepad breaks the .lang file)
Further down you will see (after options)
To add a block name, you put this code with edits of course.
My example block would be like this:
Keep in mind the unlocalized name is used!
Scrolling down more you will see the same kind of set.
Except this is for items. Do the exact same thing!
This tutorial is only for items (apples, arrows, blocks, etc.) right now.
Swords, pickaxes, shovels, hoes, will all not be included yet.
Go ahead and go to java path.
When you get there search for and open CraftManager.java
When you open the java file and scroll down a bit, you will get a line like:
Taking this line, you reitterate back
You just simply fill in the things you need. I will make a example item.
Please keep note that BLOCKIDNUMBER has to be a unique ID NUMBER.
To make example block, you need to make a 'bowl' out of cobblestone instead
of planks.
Let me explain the X's.
There is this line:
{"XXX", "XXX", "XXX", 'X', Block.BlockType}
See how there is only 3 rows of 3 X's? This is the crafting table!
The first 3 X's would state that the person should put the block
BlockType into all of the slots on top row. Same for middle and
bottom row. We can even do this if we wanted to make it not
requiring a full crafting table of BlockTypes.
{"XXX", "XXX", 'X', Block.BlockType}
Now it doesn't matter if I fill the top and middle, or bottom and middle
rows. It would still make whatever comes out of BlockType.
Notice how I have spaces? This specifically dictates where blocks CANNOT
be placed inside of your recipie.
Something like the bow (Does not go in CraftingManager. Don't try.)
{"XS ", "X S", "XS ", 'X', Item.stick, 'S', Item.string}
After the ""s you then define what the X's and S's are.
Must use ' 's
Let's say you want to make a X with wood on the outside and cobble on the inside.
{"X X", " O ", "X X", 'X', Block.planks, 'O', Block.cobblestone}
Simple!
Let's restate this correctly to make a real X recipe!
Please note you need to make a block called X inside of block.java
and make another .java file for it to define it. (See above tuts)
To Do: (Some tomorrow (Follow Post))
Creating A Sword
Making A Monster/Enitity
Publishing Your Mod
Any Confusions Please, Send me a message. No guarantees that I will respond due to idiots. Super simple questions will not be answered. If you feel like it is a question that needs asking, please state so with some backup reason why you don't understand. I aim to aid. There are no stupid questions. Unless they are what ifs. Those are not questions, they are things to think about.
If you want something added to this tutorial that is not added, or planned, please message me! Please do not be dumb.
Minecraft basically is it's own API. Please, if you do not know much don't say anything. I am telling how to use the functions and no how to code.
They are not finished yet.
Sorry, but you're the one who doesn't know much. You're trying to tell me that editing a language file with Notepad++ is the correct way to give mod items/blocks names? Your entire approach to modding is going at it from the completely wrong angle. Try downloading MCForge and using that API and its set of tools in order to make your mod. Also, Notepad++ is the worst IDE that you can be using to develop mods. Try using something such as Eclipse. There is a reason that every notable modder uses the Forge API and a proper IDE, because it allows for easy distributing and conflict resolutions.
-You're trying to tell me that editing a language file with Notepad++ is the correct way to give mod items/blocks names
No I never said that, I am suggesting a free software. This is not a tutorial for MCForge now is it? Notepad++ Is not the worst program to develop mods. Try notepad or try wordpad. Doesn't cut it does it? Eclipse is good too. But it requires setting up. I do not care what you use. Keep your ideas to yourself, if asked to. I stated, 'please do not be dumb' and to message me concerns.
Why would you aim to shoot down this? This is a specific tutorial for MCP ONLY. Not MCForge.
mwb12345 is right to suggest that Notepad++ is not a very suitable IDE to code with. Proper Java IDE's will highlight many simple issues with the code, such as if you spell a name wrong (because remember, case IS important), if you are referencing something that does not exist, etc. Eclipse also provides a method of testing your code by running Minecraft without having to recompile and reobfuscate beforehand, making it MUCH easier to test your code.
While modding base Minecraft classes with Notepad++ is possible, and is most certainly allowed, I think many people would find your tutorials more useful if you instead explained how to use Eclipse or another suitable IDE to mod with MinecraftForge or ModLoader.
The choice is up to you, however.
I agree, but again. I state that 'You can use any IDE' I was going for pure BASICS.
Are you going to finish the mob section etc? I know it's a pretty recent post (may 22 - 2013), but i think it's better to ask now rather than in 1 year.
There are not alot of textual tutorials and i prefer to read texts, as it's easier for me to understand.
Any update? keep up
Follow @SkylerandJonny
The OP wanted to show how to go about modding in a "basic" way, pretty much minimising the amount of things you need to do. Not exactly the smartest idea, and it's not exactly basic either. Either way you look at it, you still need to install stuff. Using Forge / other loaders? Just install Forge and the IDE you wish to use, learn how the Forge API works, and start modding. Not using any loaders? Install Notepad++, install MCP, install some NP++ addons that make your life easier (NP++ is not designed for Java development, it's slow, doesn't provide any tools for development by default, and in general is not for developing Java applications, IMO it's more so for quickly looking at / editing and compiling code on the fly, when it comes to Java), run decompile.bat / decompile.sh to decompile the game, learn how the Minecraft "API" works (Minecraft is not it's own API, Minecraft is just designed in such a way that abstraction is used a lot, so things are a little easier to work with), learn how to modify the Minecraft code in a cleaner and more productive and efficient way, and it goes on. All in all, using loaders alongside an IDE is quicker and easier, and more basic too.
Also this topic is a year old sooo.
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
My Github page.
The entire Minecraft shader development community now has its own Discord server! Feel free to join and chat with all the developers!