Welcome to my tutorials. I am currently working on mod's and thought that I would show you how to add things because for me, it was difficult. I will help those of you who post below for questions about modding, installing MCP or other.
[b]Installation[/b]
____________________________________
Note: During installation, make sure to ignore the "". They are there, simply for the purpose of highlighting a step or directory.
Once the following are downloaded, the steps are as follows:
1. Unzip mcp31.zip to "C:\MCP".
2. Install JDK.
3. Unzip eclipse to "C:\Program Files\Eclipse".
4. Go to "C:\Program Files" or wherever you installed JDK and find "Java". Open and then look inside the folder
starting with [b]jdk[/b]. Open "bin" and copy the location of the "bin" folder. Mine is [b]C:\Program Files\Java\jdk1.6.0_24\bin[/b] but yours may be different.
5. Click "start", right click "My Computer" and click "Properties". For Windows 7 users, click "Advanced system settings" then click "Environment Variables". For Windows XP users, click the "Advanced" tab and then click "Environment Variables".
6. Under "System variables" find "Path" and click "Edit". Add a [b];[/b] to the end of the text and paste the "bin" address from before.
7. Click "Ok" and "Ok" and you are ready for the next steps.
8. At the address bar of your computer or in "run", type in [b]%appdata%[/b]. Hit enter and open ".minecraft".
Note: Make sure that you open Minecraft beforehand and update to the latest.
9. Copy the "bin" and "resources" folders and paste them in "C:\MCP\jars".
10. Download "minecraft_server.jar" from here: [b]Download[/b]. Put this file into "C:\MCP\jars" as well.
11. Run "decompile.bat" and wait for it to finish.
12. Once finished, open "C:\MCP\conf\patches" and copy the "fg" and "start" files.
Note: The "fg" file may be a different name such as "hg" or "xy" but it will still be 2 letters long.
13. Paste the copied files in "C:\MCP\src\minecraft".
14. Open "minecraft.jar" from "C:\MCP\jars\bin" with WinRar, 7zip or a similiar program. Drag or copy every file apart from the "null", ".class" and the "net" folder into "C:\MCP\src\minecraft".
15. Open Eclipse, "eclipse.exe". Click the icon to the right of the screen labelled "Wokrbench". Then click, in the upper left corner, [b]File > Switch Workspace > Other...[/b] and type in "C:\MCP\src" and click "Ok". Once this is done, Eclipse will reload so don't be frightened.
16. Once eclipse has reloaded, click [b]File > New > Java Project[/b] and type in, next to "Project name", "minecraft". Click "Finish".
Note: You may experience some error messages down the bottom but don't be frightened about them, they will go away at the end of this tutorial.
17. Click the "minecraft" folder in the top right then click [b]Project > Properties[/b], click "Java Build Path" then click the "Libraries" tab. Click the "Add External JARs.." and then locate "C:\MCP\jars\bin" and select [b]jinput.jar[/b] + [b]lwjgl.jar[/b] + [b]lwjgl_util.jar[/b] and [b]minecraft.jar[/b].
18. Press "Open" and the [b]+[/b] icon next to all of the names to expand them, except "minecraft.jar" and "JRE System Library". Click "Native library location" and then click "Edit". Type in "C:/MCP/jars/bin/natives" as the location path. Do this for b]jinput.jar[/b] + [b]lwjgl.jar[/b] and [b]lwjgl_util.jar[/b] but not for "minecraft.jar" and "JRE System Library". Click "Ok" and if all went well, the errors should disappear.
Note: If there where many errors before then don't worry about them.
19. At the top, click [b]Run > Run Configurations...[/b]. Right click "Java Application" and next to where it says "Name", type in "MC_Config". Now click "Search" at the bottom and highlight "Start" and click "Ok".
20. Click "Apply" and then click "Run". If all went smoothly, then you should be playing minecraft with the extra "Quit Game" button.
Note: If this did not work, go back and follow the instructions more carefully or ask below.
> If this thread is rated [b]10/10[/b] in the option above "10" times. Than I will do 10 more tutorials but be weary as the option thing runs out soon.
> Wow. So the forums got updated so I couldn't keep posting the new 10 tutorials that are going to come out but now that they are back up, I'm going to create some. Most of these tutorials will be delayed until tomorrow because tomorrow is Friday.
> May 20th, 2011. 10 tutorials will be added including ModLoader compatibility, creating your own Nether and creating a new mob.
========================================== Adding a new Item.
==========================================
Well, first off, right click net.minecraft.src and create a new class. Call this new class, ItemExample. This doesn't have to be ItemExample but is the easiest to demonstrate with. So, once the new class has been created, you will be presented with a screen like this:
package net.minecraft.src;
public class ItemExample {
}
Ok, so now this is where you need to decide if you can craft your item and how much of it you can hold at any one time. For this example, I'm going to say that you are only allow to hold "8" of ItemExample and that it can be crafted. So now our code should look like this:
package net.minecraft.src;
public class ItemExample extends Item
{
public ItemExample(int i, int k)
{
super(i);
setMaxDamage(0);
setHasSubtypes(true);
maxStackSize = 8;
}
}
Item is the next thing we'll look at but currently you'll see that the damage value is set to "0" which means that it doesn't have a different type of itself, in other words, it's unique. setHasSubtypes(true) means that we are able to craft the item in the next step if we wanted to, otherwise it would be set to false. Then, maxStackSize is pretty self explanatory.
So now our item has been created, we need to give it a name, skin and properties. Close this class now, click "yes" when prompted to save and open Item.java. Here you will see a whole bunch of scary looking writing. Scroll down until you find:
public static Item recordCat = (new ItemRecord(2001, "cat")).setIconCoord(1, 15).setItemName("record");
Press enter and underneath type in the following:
public static Item example = (new ItemExample(102, 0)).setIconCoord(5, 5).setItemName("example");
Alright. So the item name is example which has been identified at the end. The ItemExample(102) set's the ID for the item. Starting from "256", "102" is added which gives up "358" because "357" is taken. "256" is the starting default number for ALL items. I usually keep a space before the last added item and the next line of code so I know what I've modded.
The setIconCoord, or co-ordinates, are set to "5, 5" which means, in the items.png found underneath gui, it will be underneath the fishing rod, next to the gold shovel and to the left of the repeater. This space is empty. The first "5" represents the column so starting at "0", which is the leather helmet we count down "5" so that we'll end up at the wooden shovel. Then, "5" to the right, we'll end up at a blank space, this is where you pixel in your desired design.
Close, save and open a new file now. Scroll up the side panel until you find lang. Expand it and click on "en_US.lang". This file can be opened with NotePad. Ok, once open, scroll down to the very bottom and underneath:
Before, we setItemName to "example". So since this is classified as an item we put "item." before the name of our item. After which the "example" part comes afterwards followed by the ".name" of the item which is presented when rolled over by our mouse. So I have put "Example" for the name of my item. The second line details a description which is not necessary but fits nicely with the rest of the scripts. Leave this blank.
addRecipe(new ItemStack(Item.example, 1), new Object[] {
"#", Character.valueOf('#'), Block.planks
});
So, in this we have crafted our "example" item by using 1 block of wood. "Item.example, 1" means that whatever you set your item name to, it will give you one of. ""#", Character.valueOf('#'), Block.planks", the easiest way to understand this part is the crafting side of things is setup like so:
XXX
XXX
XXX
Where "X" is a free space. So, if we say that "#" is a space for a block of "Block.planks", then you can put that block anywhere and it will be crafted. Let's say you typed in "#X#". This means that in any row, you can specify what the value of "#" is and what "X" is. So, in any row inside your crafting grid, you could put "#X#" to give you your outcome, you would just need to specify so. The bed is a good example to look at.
========================================== Adding a new furnace recipe.
==========================================
Alright, so let's jump straight in. Open up FurnaceRecipies. Here you will see:
addSmelting(Block.oreIron.blockID, new ItemStack(Item.ingotIron));
addSmelting(Block.oreTopaz.blockID, new ItemStack(Item.topaz));
addSmelting(Block.oreGold.blockID, new ItemStack(Item.ingotGold));
addSmelting(Block.oreDiamond.blockID, new ItemStack(Item.diamond));
addSmelting(Block.sand.blockID, new ItemStack(Block.glass));
addSmelting(Item.porkRaw.shiftedIndex, new ItemStack(Item.porkCooked));
addSmelting(Item.fishRaw.shiftedIndex, new ItemStack(Item.fishCooked));
addSmelting(Block.cobblestone.blockID, new ItemStack(Block.stone));
addSmelting(Item.clay.shiftedIndex, new ItemStack(Item.brick));
addSmelting(Block.cactus.blockID, new ItemStack(Item.dyePowder, 1, 2));
addSmelting(Block.wood.blockID, new ItemStack(Item.coal, 1, 1));
This looks harsh but really is harmless. Copy the bottom line and then add your own to the mixture.
addSmelting(Block.cobblestone.blockID, new ItemStack(Block.stone));
addSmelting(Item.clay.shiftedIndex, new ItemStack(Item.brick));
addSmelting(Block.cactus.blockID, new ItemStack(Item.dyePowder, 1, 2));
addSmelting(Block.wood.blockID, new ItemStack(Item.coal, 1, 1));
addSmelting(Item.stick.shiftedIndex, new ItemStack(Item.example, 4, 0));
Ok. So I've now made it so that when I burn a stick, it will give me "4" of "Item.example". Easy to explain. If you have multiples of one item, they are called the damage value. If the damage value is equal to "0" then it is just a single, unique item. If you see above, if you burn a cactus, it willl give you a damage value of "2" and a quantity of "1". With ours, it will give a damage value of "0" and a quantity of "4". The "shiftedIndex" just means it has to be the item specified but it can be any amount that is being burnt.
========================================== Adding a new healing Item.
==========================================
Here we go! Ok, so we don't necessarily have to create a new class but we might as well. Right click net.minecraft.src and create a new class, call it "ItemYum". Once thats done, copy the following code into it.
package net.minecraft.src;
public class ItemYum extends ItemFood
{
public ItemYum(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = k;
}
}
Right. So I made it that you can only hold as many as specified in the next section. So save and close this and open "Item.java" and under the last added "public static item" add:
public static Item yum = (new ItemYum(102, 8, false, 32)).setIconCoord(5, 5).setItemName("yum");
So here we see that the ID is "256+102" and the max stack size is "32". "false" is set because this means that the wolf will not eat it. If you wanted a wolf to eat your desired food then change "false" to "true". The rest is self explanatory. The "8" represents the healing amount. This is measured in halves. If you wanted to heal 1 and a half hearts, then you would put "3" but if you wanted to heal all 9 hearts, then you would type "18".
Bust open "en_US.lang" under lang and add, at the bottom:
Thanks! I shall get to work again!! >:biggrin.gif: Also a couple new suggestions (I hope you don't mind)
Trees that has more blocks than just leaves (so that some trees can have a block for an apple, orange, etc)
New farm item (seed -> crop -> harvesting crop)
Ridable animals
pets
Sorry if these are too hard or would take a long time or anything, but it would be very awesome if you can make these tutorials!
Thanks! I shall get to work again!! >:biggrin.gif: Also a couple new suggestions (I hope you don't mind)
Trees that has more blocks than just leaves (so that some trees can have a block for an apple, orange, etc)
New farm item (seed -> crop -> harvesting crop)
Ridable animals
pets
Sorry if these are too hard or would take a long time or anything, but it would be very awesome if you can make these tutorials!
I would do them as a mod but tutorial wise, it would be alright if it had enough support.
Cool! Are you making a mod? I have this really good idea but I don't really know all that much about Java, and I'm not even sure if I can make it with all the weird I ideas I have! XD
[b]Tiny Custom Smilies[/b]
____________________________________
[b]Regular Smilies[/b] by pixelscript
[b]Special Smilies[/b] by pixelscript
[b]Downloads[/b]
____________________________________
[b]MCP Download[/b]
Windows 32bit + 64bit
[b]5.12 MB[/b]
[b]Eclipse[/b]
Windows 32bit
[b]99.2 MB[/b]
[b]Eclipse[/b]
Windows 64bit
[b]99.2 MB[/b]
[b]JDK 6[/b]
Windows 32bit
[b]76.66 MB[/b]
[b]JDK 6[/b]
Windows 64bit
[b]67.27 MB[/b]
[b]Installation[/b]
____________________________________
Note: During installation, make sure to ignore the "". They are there, simply for the purpose of highlighting a step or directory.
Once the following are downloaded, the steps are as follows:
1. Unzip mcp31.zip to "C:\MCP".
2. Install JDK.
3. Unzip eclipse to "C:\Program Files\Eclipse".
4. Go to "C:\Program Files" or wherever you installed JDK and find "Java". Open and then look inside the folder
starting with [b]jdk[/b]. Open "bin" and copy the location of the "bin" folder. Mine is [b]C:\Program Files\Java\jdk1.6.0_24\bin[/b] but yours may be different.
5. Click "start", right click "My Computer" and click "Properties". For Windows 7 users, click "Advanced system settings" then click "Environment Variables". For Windows XP users, click the "Advanced" tab and then click "Environment Variables".
6. Under "System variables" find "Path" and click "Edit". Add a [b];[/b] to the end of the text and paste the "bin" address from before.
7. Click "Ok" and "Ok" and you are ready for the next steps.
8. At the address bar of your computer or in "run", type in [b]%appdata%[/b]. Hit enter and open ".minecraft".
Note: Make sure that you open Minecraft beforehand and update to the latest.
9. Copy the "bin" and "resources" folders and paste them in "C:\MCP\jars".
10. Download "minecraft_server.jar" from here: [b]Download[/b]. Put this file into "C:\MCP\jars" as well.
11. Run "decompile.bat" and wait for it to finish.
12. Once finished, open "C:\MCP\conf\patches" and copy the "fg" and "start" files.
Note: The "fg" file may be a different name such as "hg" or "xy" but it will still be 2 letters long.
13. Paste the copied files in "C:\MCP\src\minecraft".
14. Open "minecraft.jar" from "C:\MCP\jars\bin" with WinRar, 7zip or a similiar program. Drag or copy every file apart from the "null", ".class" and the "net" folder into "C:\MCP\src\minecraft".
15. Open Eclipse, "eclipse.exe". Click the icon to the right of the screen labelled "Wokrbench". Then click, in the upper left corner, [b]File > Switch Workspace > Other...[/b] and type in "C:\MCP\src" and click "Ok". Once this is done, Eclipse will reload so don't be frightened.
16. Once eclipse has reloaded, click [b]File > New > Java Project[/b] and type in, next to "Project name", "minecraft". Click "Finish".
Note: You may experience some error messages down the bottom but don't be frightened about them, they will go away at the end of this tutorial.
17. Click the "minecraft" folder in the top right then click [b]Project > Properties[/b], click "Java Build Path" then click the "Libraries" tab. Click the "Add External JARs.." and then locate "C:\MCP\jars\bin" and select [b]jinput.jar[/b] + [b]lwjgl.jar[/b] + [b]lwjgl_util.jar[/b] and [b]minecraft.jar[/b].
18. Press "Open" and the [b]+[/b] icon next to all of the names to expand them, except "minecraft.jar" and "JRE System Library". Click "Native library location" and then click "Edit". Type in "C:/MCP/jars/bin/natives" as the location path. Do this for b]jinput.jar[/b] + [b]lwjgl.jar[/b] and [b]lwjgl_util.jar[/b] but not for "minecraft.jar" and "JRE System Library". Click "Ok" and if all went well, the errors should disappear.
Note: If there where many errors before then don't worry about them.
19. At the top, click [b]Run > Run Configurations...[/b]. Right click "Java Application" and next to where it says "Name", type in "MC_Config". Now click "Search" at the bottom and highlight "Start" and click "Ok".
20. Click "Apply" and then click "Run". If all went smoothly, then you should be playing minecraft with the extra "Quit Game" button.
Note: If this did not work, go back and follow the instructions more carefully or ask below.
[b]Jump To:[/b]
____________________________________
> [b]Adding a new Item.[/b]
> This will teach you about adding a new Item.
> [b]Adding a crafting recipe.[/b]
This will teach you how to add the ability to craft your item, block or other.
> [b]Adding a new ore.[/b]
This tutorial is about creating a new ore.
> [b]Adding a new block.[/b]
This tutorial is about creating a new block.
> [b]Adding new tools.[/b]
This tutorial will inform you about creating tools.
> [b]Generating a new ore.[/b]
This will teach about how to allow your ore to generate naturally.
> [b]Adding a healing Item.[/b]
This will teach you about adding a new Item as food.
> [b]Crafting with dyes.[/b]
A tutorial about how to apply damage value index to a crafting recipe.
> [b]Editing TNT's blast radius.[/b]
A tutoial about how to create a very powerfully deadly explosion radius.
[b]Updates[/b]
____________________________________
> If this thread is rated [b]10/10[/b] in the option above "10" times. Than I will do 10 more tutorials but be weary as the option thing runs out soon.> Wow. So the forums got updated so I couldn't keep posting the new 10 tutorials that are going to come out but now that they are back up, I'm going to create some. Most of these tutorials will be delayed until tomorrow because tomorrow is Friday.
> May 20th, 2011. 10 tutorials will be added including ModLoader compatibility, creating your own Nether and creating a new mob.
Adding a new Item.
==========================================
Well, first off, right click net.minecraft.src and create a new class. Call this new class, ItemExample. This doesn't have to be ItemExample but is the easiest to demonstrate with. So, once the new class has been created, you will be presented with a screen like this:
Ok, so now this is where you need to decide if you can craft your item and how much of it you can hold at any one time. For this example, I'm going to say that you are only allow to hold "8" of ItemExample and that it can be crafted. So now our code should look like this:
Item is the next thing we'll look at but currently you'll see that the damage value is set to "0" which means that it doesn't have a different type of itself, in other words, it's unique. setHasSubtypes(true) means that we are able to craft the item in the next step if we wanted to, otherwise it would be set to false. Then, maxStackSize is pretty self explanatory.
So now our item has been created, we need to give it a name, skin and properties. Close this class now, click "yes" when prompted to save and open Item.java. Here you will see a whole bunch of scary looking writing. Scroll down until you find:
Press enter and underneath type in the following:
Alright. So the item name is example which has been identified at the end. The ItemExample(102) set's the ID for the item. Starting from "256", "102" is added which gives up "358" because "357" is taken. "256" is the starting default number for ALL items. I usually keep a space before the last added item and the next line of code so I know what I've modded.
The setIconCoord, or co-ordinates, are set to "5, 5" which means, in the items.png found underneath gui, it will be underneath the fishing rod, next to the gold shovel and to the left of the repeater. This space is empty. The first "5" represents the column so starting at "0", which is the leather helmet we count down "5" so that we'll end up at the wooden shovel. Then, "5" to the right, we'll end up at a blank space, this is where you pixel in your desired design.
Close, save and open a new file now. Scroll up the side panel until you find lang. Expand it and click on "en_US.lang". This file can be opened with NotePad. Ok, once open, scroll down to the very bottom and underneath:
Type:
Before, we setItemName to "example". So since this is classified as an item we put "item." before the name of our item. After which the "example" part comes afterwards followed by the ".name" of the item which is presented when rolled over by our mouse. So I have put "Example" for the name of my item. The second line details a description which is not necessary but fits nicely with the rest of the scripts. Leave this blank.
Adding a new crafting recipe.
==========================================
Under net.minecraft.src, find "CraftingManager.java". Open this up and scroll down and find:
Hit enter and type in the following code:
So, in this we have crafted our "example" item by using 1 block of wood. "Item.example, 1" means that whatever you set your item name to, it will give you one of. ""#", Character.valueOf('#'), Block.planks", the easiest way to understand this part is the crafting side of things is setup like so:
Where "X" is a free space. So, if we say that "#" is a space for a block of "Block.planks", then you can put that block anywhere and it will be crafted. Let's say you typed in "#X#". This means that in any row, you can specify what the value of "#" is and what "X" is. So, in any row inside your crafting grid, you could put "#X#" to give you your outcome, you would just need to specify so. The bed is a good example to look at.
Anthrocraft http://www.minecraft...f=1021&t=231356
Green Screenhttp://www.minecraft...f=1021&t=236906
Minecraft Mojang Fix http://www.minecraft...f=1032&t=26687
Adding a new furnace recipe.
==========================================
Alright, so let's jump straight in. Open up FurnaceRecipies. Here you will see:
This looks harsh but really is harmless. Copy the bottom line and then add your own to the mixture.
Ok. So I've now made it so that when I burn a stick, it will give me "4" of "Item.example". Easy to explain. If you have multiples of one item, they are called the damage value. If the damage value is equal to "0" then it is just a single, unique item. If you see above, if you burn a cactus, it willl give you a damage value of "2" and a quantity of "1". With ours, it will give a damage value of "0" and a quantity of "4". The "shiftedIndex" just means it has to be the item specified but it can be any amount that is being burnt.
Maybe a bit later, once this thread gets some reputation.
Oh alright well will you pm when you create it?
Anthrocraft http://www.minecraft...f=1021&t=231356
Green Screenhttp://www.minecraft...f=1021&t=236906
Minecraft Mojang Fix http://www.minecraft...f=1032&t=26687
Indeed. But I still need feedback from you about the tutorials.
Adding a new healing Item.
==========================================
Here we go! Ok, so we don't necessarily have to create a new class but we might as well. Right click net.minecraft.src and create a new class, call it "ItemYum". Once thats done, copy the following code into it.
Right. So I made it that you can only hold as many as specified in the next section. So save and close this and open "Item.java" and under the last added "public static item" add:
So here we see that the ID is "256+102" and the max stack size is "32". "false" is set because this means that the wolf will not eat it. If you wanted a wolf to eat your desired food then change "false" to "true". The rest is self explanatory. The "8" represents the healing amount. This is measured in halves. If you wanted to heal 1 and a half hearts, then you would put "3" but if you wanted to heal all 9 hearts, then you would type "18".
Bust open "en_US.lang" under lang and add, at the bottom:
For taking the time out to post on this thread I'll make a tutorial on how to setup all of the following.
Anytime Valonthetalon! If you need help, PM me or reply here at this post.
BTW some suggestions for future tutorials that would maybe skyrocket your views xD
Vehicles like Flan's mods
Shooting weapons (and regular weapons) with range EX: Spear
How to make the white part of terrain.png transparent XD
It's just some suggestions, which might attract some people into reading! (I know I definitely would!)
Thanks for the suggestions! Plus, the link works now. Sorry about that.
Trees that has more blocks than just leaves (so that some trees can have a block for an apple, orange, etc)
New farm item (seed -> crop -> harvesting crop)
Ridable animals
pets
Sorry if these are too hard or would take a long time or anything, but it would be very awesome if you can make these tutorials!
I would do them as a mod but tutorial wise, it would be alright if it had enough support.
Another suggestion!
SMP- support!