waaaahhh!!! when will the next tutorial come out??? I REALLY hope its about putting effects on weapons and armor besides setting them on fire. I wanna make my enemies get poisoned or get covered in Ice Blocks after being right-clicked at or having an armor that sets enemies on fire just by merely getting close to them or being invisible as long as you wear the armor ooor being able to breath underwater when you wear the whole set oooooor be able to fly!!! X3 I hope the next tutorial comes soon~
Hi again! Got another request for a video. Please make a video on making Bosses and one on making like Castles spawning in the word, like in the Twilight Forrest. Thank you! ^^
Hey SCMowns, when I make an Item, it doesn't show up in the game. Can you help me out?
To add your items into you creative tabs you need to add ".setCreativeTab(CreativeTabs.tabMaterials)" #Note change Materials to what ever tab.
So put that code in after "public static final Item ItemNAME= new ItemItemNAME(3000).setItemName("ItemNAME")#Put the code here#;"
Welcome, my username is SCMowns (if you didn't already know) and I'm going to be showing you some very basic steps in order to start modding. My coding series has started on 1.2.5 so you're not to late to join in! and with my simple tutorials you'll be making mods fast and simple! Soon were gonna be going into some Minecraft forge coding and doing some advance tutorials. So how about it! Begin modding!
[media][media][/media[/media]]
You need a software that can allow you to make transparent pictures, like Paint.net Mod_NAME
package net.minecraft.src;
import java.util.Random;
public class mod_NAME extends BaseMod
{
public static final Item NAMEhere = new ItemNAME(2085).setItemName("NAME");
public void load()
{
NAMEhere.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png");
ModLoader.addName(NAMEhere, "Ingame -Name");
}
public String getVersion()
{
return "3.14159265";
}
}
To understand this code is quite simple, public class final Item is telling Minecraft that you are making a new item, the (2085) is the Item ID, and the .setItemName("NAME"); is required, but dosn't need a fancy name! in the public void load() section, you will tell modloader where your items is located at, what is needed in order to craft it, and what the name is. My tutorial mentions all this.
ItemNAME:
package net.minecraft.src;
import java.util.Random;
public class ItemNAME extends Item
{
public ItemNAME(int i)
{
super(i);
maxStackSize = 64;
}
public String Version()
{
return "3.14159265";
}
}
Here is another separate class you will need to make. This will define the Item of how much it can stack and to make it an official item registered onto Minecraft
My picture that I used in this tutorial can be downloaded here! (16x16)
3.Making a Sword ( 1.2.5 / 1.3.2 / 1.4.6 )
[media][media][/media[/media]]
public static final Item NAMESword = new ItemSword(3077, EnumToolMaterial.GOLD).setItemName("AnythingHere");
In my tutorial i might have mentioned to edit a BASE class, don't do it! in this code of line you will need to make a new sword and later define it in your public void load. replace NAME with the name of your sword.
paste this in your public void load()
The first line of code is telling modloader to override minecraft item's picture with your new sword sprite. The second line is adding in a name for your sword. In the "NAME Sword" call your sword what ever you like. The tutorial goes over everything.
The picture of the sword that I used can be downloaded here!(16x16)
4. Pickaxe ( Tool set ) ( 1.2.5 / 1.3.2 / 1.4.x )
[media][/media]
In your static section paste this:
public static final Item NAMEPick = new ItemPickaxe(2102, EnumToolMaterial.GOLD).setItemName("Whatever");
replace the NAME with a name of your choice. EnumToolMaterial.GOLD is the tool material, so it's set as gold (defualt). Paste this line of code in your public void load():
NAMEPick.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png");
ModLoader.addName(NAMEPick, "NAME Pickaxe");
ModLoader.addRecipe(new ItemStack(NAMEPick, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Block.dirt
});
The green Pickaxe picture that was used can be downloaded here! (16x16)
5. Axe ( Tool Set ) (1.2.5 / 1.3.2 / 1.4.x )
[media][media][/media[/media]]
In your static section paste this:
public static final Item NAMEAxe = new ItemAxe(2096, EnumToolMaterial.GOLD).setItemName("whatever");
Paste these lines of code in your public void load():
[media][media][/media[/media]]
In your static section paste this:
public static final Item NAMESpade = new ItemSpade(2099, EnumToolMaterial.GOLD).setItemName("Whatever");
Paste these lines of code in your public void load():
NAMESpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png");
ModLoader.addName(NAMESpade, "NAME Shovel");
ModLoader.addRecipe(new ItemStack(NAMESpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Block.dirt
});
Watch the video for information of these lines of code!
The green Shovel picture that was used can be downloaded here! (16x16)
8. Ore Generating (1.2.5 / 1.3.2 / 1.4.x )
[media][media][/media[/media]]
pase this line of code in your public static section:
public static final Block NAMEBlock = new BlockNAME(151, 0).setHardness(6F).setResistance(7.0F).setBlockName("whatever");
Create a new class ( for your BlockNAME, and copy nnd paste this code in:
package net.minecraft.src;
import java.util.Random;
public class BlockNAME extends Block
{
protected BlockNAME(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_NAME.ITEM.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}
public String Version()
{
return "3.14159265";
}
}
follow the video tutorial if you get stuck or confused. Now paste these lines of code in you Public void load():
ModLoader.registerBlock(NAMEBlock);
NAMEBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png" , "/items/pic.png");
ModLoader.addName(NAMEBlock, "In Game Name Ore");
once you have paste that line of code, be sure to change any (NAME) with your block name, now under your static final section, not your public void load. You paste these lines of code:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(20);
int randPosY = random.nextInt(40);
int randPosZ = chunkZ + randomGenerator.nextInt(20);
(new WorldGenMinable(NAMEBlock.blockID, 4)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
This line of code deals with your actual ore generation in chunks. If you would like to generate more ore everywhere then mess with this line of code: for (int i = 0; i < 10; i++) - Change 10 to 30 and see the difference. If you know Minecraft's XYZ's coordence then you can easly chnage where ore will spawn underground. I cover a lot of lines in my video. So check it out!
The green Ore picture that was used can be downloaded here! (16x16)
9. Armor set (1.2.5 / 1.3.2 / 1.4.x)
[media][media][/media[/media]]
Make a new class, and paste this in your mod_NAMEARMOR:
package net.minecraft.src;
import net.minecraft.client.Minecraft;
public class mod_NAME extends BaseMod
{
public void load()
{
}
public String Version()
{
return "1.4.2";
}
public String getVersion()
{
return "3.14159265";
}
}
This is the Basic Modloader coding format. You will use this like a normal mod_file you have made. In your Static final body paste these lines of code:
public static final Item NAMEBody = (new ItemArmor(2200, EnumArmorMaterial.GOLD ,5,1 ).setItemName("Whatever"));
public static final Item NAMEHelmet = (new ItemArmor(2201,EnumArmorMaterial.GOLD ,5,0 ).setItemName("Whatever"));
public static final Item NAMEPants = (new ItemArmor(2202,EnumArmorMaterial.GOLD ,5,2 ).setItemName("Whatever"));
public static final Item NAMEBoots = (new ItemArmor(2203,EnumArmorMaterial.GOLD, 5, 3 ).setItemName("Whatever"));
We are defining the items that you will use to place on your armor slots. Keep in mind this line of code (5,0) The 5 is the new armor number you have added. Since Minecraft has 4 armor sets you are adding in the 5th set. ( If you add in more armor be sure to increase that number to 6) - Now the 0 is where the item will be placed on the armor slots. 0 = HELMET, 1 = BODY, 2 = PANTS, and 3 = BOOTS.
Now paste these lines of code in your Public void load():
10. Publishing / Converting your mod into a download! (1.2.5 / 1.3.2 / 1.4.x )
[media][media][/media[/media]]
It's very simple. Just follow my tutorial xD
11. Smelting ( 1.2.5 ONLY )
[media][media][/media[/media]] *This video and code only work for Minecraft 1.2.5 MCP coding!* Updated code is located down below!
Paste this line of code in your public void load():
ModLoader.addSmelting(BLOCK.blockID, new ItemStack(ITEM, 1));
[media][media][/media[/media]]
The same Idea as in making a block, but a few changes.
Copy and paste this line of code in your "public static final section"
public static final Block NAMEBlock = new BlockNAME(160, 0).setBlockName("whatever").setHardness(5F).setResistance(6F).setStepSound(Sound);
You will need to follow my video for a great description of this line and the following lines.
Copy and paste these lines in your public void load:
And for your BlockNAME you will need to create a new class to define it, make a new class and paste in this code:
in your BlockNAME:
package net.minecraft.src;
import java.util.Random;
public class BlockNAME extends Block
{
public BlockNAME(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_NAME.BLOCK.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
Download my Block that I used in my tutorial Here!
13. Updating your mod to Minecraft 1.3 ( Old ) ( 1.3 )
[media][media][/media[/media]]
STEPS:
- Download Modloader 1.3
- Download the new MCP V1.7 ( for Minecraft 1.3 )
- Get a fresh Minecraft.jar
- (Optional) Get a Minecraft_Server.jar 1.3
- Copy and paste your "Bin" and "resources" folders in your "jars" folder.(make sure you have modded minecraft.jar with modloader
- Decompile
- Move over Old src to New Src
*How to Move Over*
- Either look for your class files in your old src and move over
- Or, Highlight ALL, *copy* and paste in new src, But DON'T REPLACE
- Recompile
- Look for errors. ( you might get 1 )
- Move over pictures / items to new location.
- Open eclipse, and look for your mod_NAME
- Run Minecraft, and enjoy your mod!
Get the New MCP for Minecraft 1.3 and downloads Here!
14. Updating your mod to 1.3.2, with New coding and Fixes* ( 1.3.2 )
What to do!
- Update your version of MCP to 1.3.2
- Copy your old src (source) to your new moddings folder (you can get mine)
- Copy your pictures as well
- Fix errors. If any (look for red lines)
15. Food ( 1.2.5 / 1.3.2 / 1.4.x )
[media][/media]
Paste this line of code in your public static final section:
public static final Item nameHere = new ItemFood(5000, 6, 1F, true).setItemName("anyNameHere");
It's just like making an Item, but this time you make sure it extends ItemFood.
The 1F means how many 1/2 hunger bar is your food going to fill up, so 2 = 1 bar, 3 = 2 1/2, and so on.
The 6 is how long till you get hungy again, 5 is normal, and 3 is very low where you will starve again! The true statement is if you can feed it to a wolf. true = yes, and false = No.
Now paste this line of code in your public void load():
foodNameHere.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/image.png");
ModLoader.addName(foodNameHere, "My Food");
ModLoader.addRecipe(new ItemStack(Food01, 5), new Object[]
{
"***", "* *", "***",
'*', Item.sugar
});
//IF SMELTING ITEM TO ITEM
ModLoader.addSmelting(yourItem.shiftedIndex, new ItemStack(yourSmeltedItem, 1), 1.0F);
//IF SMELTING BLOCKS TO BLOCKS
ModLoader.addSmelting(yourBlock.blockID, new ItemStack(yourSmeltedBlock, 1), 1.0F);
The 1.0F is how much exp you'll recieve with smelting successfully. The rest is explained in my tutorial.
17. Adding Items / Blocks to your Creative Tab ( 1.3.2 / 1.4.x )
[media][media][/media[/media]]
//For a Item:
YourItem.setTabToDisplayOn(CreativeTabs.tabMaterials);
//For a Block
this.setCreativeTab(CreativeTabs.tabBlock);
If you have a sword, then remove the (CreativeTabs.tabMaterials) and spell in " (CreativeTabs. " if you put that point "." you should have a list of the tabs available, like the Materials Tab, Combat, Misc, Food, Tools, etc.
18. Updating your mod to 1.4.2 ( 1.3.2 / 1.2.5 / 1.4.x )
package net.minecraft.src;
import java.awt.Color;
import java.util.Map;
public class mod_NAME extends BaseMod
{
public String getVersion()
{
return "1.4.2";
}
public void load()
{
ModLoader.registerEntityID(EntityNAME.class, "NAME", 30);//registers the mobs name and id
ModLoader.addSpawn("NAME", 15, -5, 1, EnumCreatureType.monster);//makes the mob spawn in game
ModLoader.addLocalization("entity.NAME.name", "NAME");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(30), new EntityEggInfo(30, 894731, (new Color(21, 15, 6)).getRGB()));//creates the spawn egg, and chnages color of egg
}
public void addRenderer(Map var1)
{
var1.put(EntityNAME.class, new RenderLiving(new ModelNAME(),.5f));
}
}
First off make yourself a new class, replace all the NAME with the actualy name that you have chosen. In the public void load() Modloader registers the mob/entity that you are creating. I have left side notes on most of the line of code for you to understand what they mean. EntityNAME:
package net.minecraft.src;
public class EntityNAME extends EntityMob//extend this to make mob hostile
{
public EntityNAME(World par1World)
{
super(par1World);
this.texture = "/mob/NAME.png";//Set Mob texture
this.moveSpeed = 0.4f;//sets how fast this mob moves
isImmuneToFire = false;
//below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(2, new EntityAIMoveTwardsRestriction(this, this.moveSpeed));
this.tasks.addTask(3, new EntityAIWander(this, this.moveSpeed));
this.tasks.addTask(4, new EntityAILookIdle(this));
this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 25.0F, 0, true));
}
public int func_82193_c(Entity par1Entity) //the amount of damage
{
return 4;
}
protected void fall(float par1) {}
public int getMaxHealth() // Mob health
{
return 10;
}
protected String getLivingSound()
{
return "mob.pig.say";
}
protected String getHurtSound()
{
return "mob.pig.say";
}
protected String getDeathSound()
{
return "mob.pig.death";
}
protected int getDropItemId()
{
return Item.stick.shiftedIndex;
}
protected boolean canDespawn()
{
return true;
}
protected boolean isAIEnabled()//Allow your AI task to work?
{
return true;
}
}
Each line is pretty much self explanatory, watch my video and read the side notes to understand the code.
To turn off the fire aspect, put return false; The 5 is the amount of ticks the fire will remain on the entity. Raise it higher if you wish the mod will remain on fire for a very long time.
24. Fuel for Items / Blocks (1.4.x) (New!)
[media] [/media]
public int addFuel(int par1, int par2)
{
if(par1 == ITEM.shiftedIndex)//200 ticks is normal,1600 ticks is coal
{
return 200;
}
if(par1 == BLOCK.blockID)
{
return 200;
}
return 0;
}
Watch the video for some additional information!
25. Achievements (1.4.x) (NEW)
[media][/media]
These line of codes were used in my video, I have explained what they mean. Paste these lines of code in your "public class" section
public static final Achievement achievementFood = new Achievement(5400, "achievementFood", 10, 9, Item.sugar, null).setSpecial().setIndependent().registerAchievement();
public static final Achievement achievementGem = new Achievement(5401, "achievementGem", 10, 12, Item.bone, achievementFood).registerAchievement();
Paste these lines of code in your "public void load()"
ModLoader.addAchievementDesc(achievementFood, "Yummy!", "Craft a Donut!!");
ModLoader.addAchievementDesc(achievementGem, "Green GEM!", "Pick Up a Green Gem!");
paste these lines of code underneath the public void load, make sure you do notpaste them in public void load():
[media][/media]
Follow the tutorial on making a new WorldGenNether class by copying the src code from WorldGenMinable.
Here is the code that you will place in your mod_mod:
public void generateNether(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
int veinsize=8;//Size of the vein
int rarity=12;//the rarity of the ore
for (var5 = 0; var5 < rarity; ++var5)
{
var6 = var3 + var2.nextInt(16);
var7 = var2.nextInt(128);
var8 = var4 + var2.nextInt(16);
new WorldGenNether(Block.dirt.blockID, veinsize).generate(var1, var2, var6, var7, var8);//replace dirt with your custom ore
}
}
I left some side notes, explaining the obvious. But anyways! Hope this helps!
27. Advance Blocks: Gravitational Physics, Light Value, and Unbreakable(1.4.x) (New!)
[media][/media]
For the gravitational block you'll need to follow along with my tutorial,
to make your block unbreackable add in this line of code to your "pubic static final"
.setBlockUnbreakable()
Now to make your block have a light value, you'll add this line of code to your "public static final"
.setLightValue(5)
Increase or decrease the number 5 to lower or increase the light radius.
Last thing to say!
Thank you for support!
Get our Banner below!
[represent]
Are you going to do forge mods and tutorials too?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
(Request: Can You make a tutorial on GUI soon? (Like new armor slots or new crafting tables))
Edit: actually could you make one just on advanced items, and crafting
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumchange shiftedIndex to itemID
And now i made:
http://www.minecraftforum.net/topic/1636909-wip-147-modloader-minecraft-rednetworktools-mod/#entry20194338
Thank you and good day to you sir.
To add your items into you creative tabs you need to add ".setCreativeTab(CreativeTabs.tabMaterials)" #Note change Materials to what ever tab.
So put that code in after "public static final Item ItemNAME= new ItemItemNAME(3000).setItemName("ItemNAME")#Put the code here#;"
Are you going to do forge mods and tutorials too?