This page will be the host of my tutorials. please visit here and leave comments, good or bad. oh and leave suggestions on what i should make tuts on.
you will need to have mcp set up and decompiled. src means source and is the folder in your mcp jar called src. mcp set up tut for windows. I recorded my own and will do a video series to start with.
ModFiles
This tut will cover setting up a modfile to be used. You will need modloader for this coding.
Step 1 make your file. You do so by making a new text file and naming it somewhere along the lines on mod_thename. whether it matters between mod_ or Mod_ i don't think has any effect but i use the lowercase version and it seems to work fine. you need to change the .txt at the end to .java so that eclipse or net beans or what ever editor you use can open it. i recomend eclipse as it has some autocomplete things and allows running minecraft without having to recompile and open the test client.
Step 2 open it and enter your starter code
package net.minecraft.src;
import java.util.Random;
public class mod_modname extends BaseMod
{
@Override
public String getVersion()
{
return "Printed behind the modname.";
}
@Override
public void load()
{
}
public mod_modname()
{
}
}
you replace the mod_thenames and "mod name" with the name of your mod. the name you set for the public class has to match the name of the file or it will Not work. java is case sensitive and it throws errors on any kind of issue like that.
okay now for basic explanations of things.
package net.minecraft.src;
This line covers where the file is. it tells it to look in the main part of your src file in mcp. most likely trying
package net.minecraft.src.newfolder;
Will cause it to get files in the source from a folder called newfolder.
public class mod_thename extends BaseMod
This covers the class name. public makes it usable and class makes it a class file. mod_thename is well the name. the extends means it uses the file as a base file. BaseMod is linked to modloader, which allows you to use modloader's functions in your mod file. Modloader's file is labeled as ModLoader.java
public mod_thename()
This allows you to add things in the file. this is the section know as the constructor, it can be used for modloader things, and is where you put the modloader code. both the public class and this part have to match spelling and all or it will not allow the class file to work.
@Override
public String Version()
{
return "mod name";
}
This is a basic function that is required by all mod files. the
@Override
Tells the compiler that this overrides the base file. don't worry about it. its mostly a bug catcher from what i see.
public String Version()
{
return "mod name";
}
This basically sets the name of the mod-file, you can put pretty much anything here.
Basic ModLoader Uses
most of these start with ModLoader. this means it uses fuctions and things from modloader.
I would like to say that you can put as many of these in a modfile as you want. there is only a limit on sprites for like texture and ids for the item or block. Never is making multiple mod_ files better. it means there are more files and they are just a pain and also it takes so much longer to update when you have multiple.
This page will be the host of my tutorials. please visit here and leave comments, good or bad. oh and leave suggestions on what i should make tuts on.
you will need to have mcp set up and decompiled. src means source and is the folder in your mcp jar called src. mcp set up tut for windows. I thank GlennBrannMC for the video used.
ModFiles
This tut will cover setting up a modfile to be used. You will need modloader for this coding.
Step 1 make your file. You do so by making a new text file and naming it somewhere along the lines on mod_thename. whether it matters between mod_ or Mod_ i don't think has any effect but i use the lowercase version and it seems to work fine. you need to change the .txt at the end to .java so that eclipse or net beans or what ever editor you use can open it. i recomend eclipse as it has some autocomplete things and allows running minecraft without having to recompile and open the test client.
Step 2 open it and enter your starter code
package net.minecraft.src;
import java.util.Random;
public class mod_thename extends BaseMod
{
public mod_thename()
{
}
@Override
public String Version()
{
return "mod name";
}
}
you replace the mod_thenames and "mod name" with the name of your mod. the name you set for the public class has to match the name of the file or it will Not work. java is case sensitive and it throws errors on any kind of issue like that.
okay now for basic explanations of things.
package net.minecraft.src;
This line covers where the file is. it tells it to look in the main part of your src file in mcp. most likely trying
package net.minecraft.src.newfolder;
Will cause it to get files in the source from a folder called newfolder.
public class mod_thename extends BaseMod
This covers the class name. public makes it usable and class makes it a class file. mod_thename is well the name. the extends means it uses the file as a base file. BaseMod is linked to modloader, which allows you to use modloader's functions in your mod file. Modloader's file is labeled as ModLoader.java
public mod_thename()
This allows you to add things in the file. this is the section know as the constructor, it can be used for modloader things, and is where you put the modloader code. both the public class and this part have to match spelling and all or it will not allow the class file to work.
@Override
public String Version()
{
return "mod name";
}
This is a basic function that is required by all mod files. the
@Override
Tells the compiler that this overrides the base file. don't worry about it. its mostly a bug catcher from what i see.
public String Version()
{
return "mod name";
}
This basically sets the name of the mod-file, you can put pretty much anything here.
Basic ModLoader Uses
most of these start with ModLoader. this means it uses fuctions and things from modloader.
I would like to say that you can put as many of these in a modfile as you want. there is only a limit on sprites for like texture and ids for the item or block. Never is making multiple mod_ files better. it means there are more files and they are just a pain and also it takes so much longer to update when you have multiple.
ModLoader.RegisterBlock(newblock);
This is the piece of code that is used when you make a block that basically makes the game aware that this block exists. if you forget this piece of code any crafting recipes that make it will crash the game as it would basically be missing it's existence.
ModLoader.AddName(newblock, "This is the blocks highlighted name");
This line of code is what sets the name of the object when you put your mouse over it.
Newblock is the name of the actual block or item and then you put what name you want to appear in the ""s.
this is an example of setting a texture on a block. its the name of the block, followed by the .blockIndexInTexture which tells it this is a block texture and not an item texture. then the
is what sets the texture. the first part is what is overriden and the second part is the actual texture. this one overrides terrain.png which is for blocks.
Awsome! but what do I do if I can't install a mod by my self?
you will need to have mcp set up and decompiled. src means source and is the folder in your mcp jar called src. mcp set up tut for windows. I recorded my own and will do a video series to start with.
ModFiles
This tut will cover setting up a modfile to be used. You will need modloader for this coding.
Step 1 make your file. You do so by making a new text file and naming it somewhere along the lines on mod_thename. whether it matters between mod_ or Mod_ i don't think has any effect but i use the lowercase version and it seems to work fine. you need to change the .txt at the end to .java so that eclipse or net beans or what ever editor you use can open it. i recomend eclipse as it has some autocomplete things and allows running minecraft without having to recompile and open the test client.
Step 2 open it and enter your starter code
you replace the mod_thenames and "mod name" with the name of your mod. the name you set for the public class has to match the name of the file or it will Not work. java is case sensitive and it throws errors on any kind of issue like that.
okay now for basic explanations of things.
This line covers where the file is. it tells it to look in the main part of your src file in mcp. most likely trying
Will cause it to get files in the source from a folder called newfolder.
This covers the class name. public makes it usable and class makes it a class file. mod_thename is well the name. the extends means it uses the file as a base file. BaseMod is linked to modloader, which allows you to use modloader's functions in your mod file. Modloader's file is labeled as ModLoader.java
This allows you to add things in the file. this is the section know as the constructor, it can be used for modloader things, and is where you put the modloader code. both the public class and this part have to match spelling and all or it will not allow the class file to work.
This is a basic function that is required by all mod files. the
Tells the compiler that this overrides the base file. don't worry about it. its mostly a bug catcher from what i see.
This basically sets the name of the mod-file, you can put pretty much anything here.
Basic ModLoader Uses
most of these start with ModLoader. this means it uses fuctions and things from modloader.
I would like to say that you can put as many of these in a modfile as you want. there is only a limit on sprites for like texture and ids for the item or block. Never is making multiple mod_ files better. it means there are more files and they are just a pain and also it takes so much longer to update when you have multiple.
Use the property tables on my site at http://cth977.com/Modding Tutorials.html
I shall send Crawlers after you!
Awsome! but what do I do if I can't install a mod by my self?
What do you mean by that?
I shall send Crawlers after you!