Minecraft Blogs / Tutorial

weekly modding tutorials 2: recipes

  • 516 views, 1 today
  • 5
  • 2
  • 7
waterskier's Avatar waterskier
Level 54 : Grandmaster Pony
158
Hey everyone. today I'm going to be showing you how to make a new recipe. We are going to be making a dirt to diamond recipe.Lets get started

here is #3 http://www.planetminecraft.com/blog/modding-tutorials-3-blocks/

*DO NOT POST THIS ONE ON PLANET MINECRAFT. EASY MODS ARE NOT ALLOWED ON PMC*

getting eclipse ready to code
first open your modding folder
then go into your eclipse folder
double click on the eclipse application
when it opens click browse (or search depending on your eclipse version)
then open your modding folder,mcp,and then click once on the eclipse folder IN MCP NOT THE ACCTUAL ONE
then click on workbench (not minecraft workbench) in the top right/ hand corner
once you have chosen that you will know you did it right because a client folder and a server folder will appear.
click client, then src, then net.minecraft.src
those are all of the files that make up minecraft
then click 1 time on one of the class files
then right click
click new --> class
name it mod_YOURMODSNAME
then click finish

it should make a new class with this in it

mod starting text

package net.minecraft.src;

public class mod_YOURMODSNAME {

}



first thing we do is make the mod use things from the classes in modloader.
we do that by changing the third line from
public class mod_YOURMODSNAME {
to
public class mod_YOURMODSNAME extends basemod {

all mod_ classes have to have 2 methods getversion and load
getversion basically asks minecraft what version is this? and minecraft will respond.
and sorry but I'm not sure what load does, but I do know that you need it in all mod_ classes

after those are done it will look like this
mod step 2

package net.minecraft.src;

public class mod_YOURMODSNAME extends BaseMod{

@Override
public String getVersion() {
return null;
}

@Override
public void load() {

}

}


now that we have got all the essentials we can make the recipe
this is the acctual recipe and an explanation of it

ModLoader.addRecipe(new ItemStack(Item.diamond, 64)
this is saying hey modloader I have a new recipe for you its going to make 64 diamond
new Object[] {"000", "000", "000", Character.valueOf('0'), Block.dirt});
this is saying here is how you make the diamond. dirt= 0 and you make it by putting dirt in every square.
Here is the whole thing together
mod finished

package net.minecraft.src;

public class mod_YOURMODSNAME extends BaseMod{

@Override
public String getVersion() {
return null;
}

@Override
public void load() {

ModLoader.addRecipe(new ItemStack(Item.diamond, 64), new Object[] {"000", "000", "000", Character.valueOf('0'), Block.dirt});

}

}

thanks for reading. Leave any error code in the comments along with suggestions for new tutorials. and as always diamond and subscribe!!!

also this won't be weekly anymore. Probably more like bi-tri weekly now.
Tags

Create an account or sign in to comment.

Sellotaper
10/14/2012 12:58 pm
Level 49 : Master Musician
Sellotaper's Avatar
do you know a placewhere i could look at all the names for the blocks as in block.cobblestone and other blocks?
1
gogocp
08/04/2012 9:44 am
Level 16 : Journeyman Nerd
gogocp's Avatar
I can't get to the MCP folder from Search. Help?
1
waterskier
08/06/2012 4:27 pm
Level 54 : Grandmaster Pony
waterskier's Avatar
restart from tutorial 1, it wont exist unless you did what i said there
1
gogocp
08/07/2012 11:49 am
Level 16 : Journeyman Nerd
gogocp's Avatar
I did, but I'll try again.
1
KnobleKnives
06/04/2012 2:07 pm
Level 71 : Legendary Lad
KnobleKnives's Avatar
And what is workbench, I have eclipse indigo
1
KnobleKnives
06/04/2012 2:06 pm
Level 71 : Legendary Lad
KnobleKnives's Avatar
Alright, got a couple probs. First of all, there isn't an src folder inside client in the eclipse folder IN the mcp folder. All I see are classpath files and .settings files in both client and server. Second of all, what the heck does decompile.bat do? I ran it and only two things came up. Third of all, how do I make the public class file. I can't put in extends basemod. Finally, what are getversion and load?
1
Snurly
04/30/2012 2:46 am
Level 32 : Artisan Pixel Painter
Snurly's Avatar
Am I in the new mod team?
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome