This is my new tutorial on Minecraft modding! I will slowly add these tutorials. The ones with spoilers have the info you need to make it. Read setting up your mod first.
Tell me if some code doesn't work please!
- Setting Up Your Mod
mod_test
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map;
import java.awt.Color;
public class mod_test extends BaseMod
{
public void load()
{
}
public String getVersion()
{
return "1.4.4";
}
}
Okay at the top it says mod_test you can change this to anything like mod_fire or mod_good. Also the mod_test will be the name of your .java file. So if you changed you mod_test to mod_swordcraft the name of the .java file this is in should be mod_swordcraft.java that's it! If you need help with this reply for help! For all tutorials you can make the change the .java class name if you do it correctly.
- Blocks
mod_test
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map;
import java.awt.Color;
public class mod_test extends BaseMod
{
public static final Block chippedstone = new Blockchippedstone(160, 0).setStepSound(Block.soundStoneFootstep).setBlockName("chippedstone").setHardness(4.5F).setResistance(5F).setLightValue(0F).setCreativeTab(CreativeTabs.tabBlock);;
public void load()
{
chippedstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mymod/chippedstone.png");
ModLoader.addName(chippedstone, "Chipped Stone");
ModLoader.registerBlock(chippedstone);
}
public String getVersion()
{
return "1.4.4";
}
}
Blockchippedstone
package net.minecraft.src;
import java.util.Random;
public class Blockchippedstone extends Block
{
public Blockchippedstone(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_test.chippedstone.blockID;
}
}
You can change the Hardness or any of the other things near it if it has a (5F) or something F. You can change the 5F to a 3F if you want to.
- Item
mod_test
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map;
import java.awt.Color;
public class mod_test extends BaseMod
{
public static final Item wateringot = new Itemwateringot(200).setItemName("wateringot");
public void load()
{
wateringot.iconIndex = ModLoader.addOverride("/gui/items.png", "/mymod/wateringot.png");
ModLoader.addName(wateringot, "Water Ingot");
}
public String getVersion()
{
return "1.4.2";
}
}
Itemwateringot
package net.minecraft.src;
public class Itemwateringot extends Item
{
public Itemwateringot(int i)
{
super(i);
maxStackSize = 64;
}
}
- Mobs
mod_test
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map;
import java.awt.Color;
public class mod_test extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(EntityKnight.class, "Knight", 25);
ModLoader.addSpawn("Knight", 20, 1, 1, EnumCreatureType.creature);
ModLoader.addLocalization("entity.Knight.name", "Knight");
EntityList.entityEggs.put(Integer.valueOf(25), new EntityEggInfo(25, 5642, (new Color(37, 84, 3)).getRGB()));
}
public String getVersion()
{
return "1.4.4";
}
}
EntityKnight
package net.minecraft.src;
public class EntityKnight extends EntityMob
{
public EntityKnight(World par1World)
{
super(par1World);
this.texture = "/wau/Dead Explorer.png";
this.moveSpeed = 0.3f;
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, 16.0F, 0, true));
}
public int func_82193_c(Entity par1Entity)
{
return 4;
}
public int getMaxHealth()
{
return 45;
}
protected boolean isAIEnabled()
{
return true;
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.swordSteel, 1);
}
private static final ItemStack defaultHeldItem;
protected int getDropItemId()
{
return Item.arrow.shiftedIndex;
}
}
All of it is straight forward but the texture will have to be like a skin you upload for your minecraft account. On mod_test it says 20, 1, 1 on the addspawn line. The 20 means the rarity 20 is pretty normal. The first one means the minimum amount you can find spawn together and the third one is the maximum amount you can see in a group. If you want it to be a creature like a pig change the ModLoader.addSpawn("Knight", 20, 1, 1, EnumCreatureType.creature); to creature (already is creature). If you want it to be like a zombie change it to monster. If you want it to be a creature and spawn in water only change it to waterCreature. If you dont want you'r mob to fight back remove this line of code in the Entity****.java file. Here is the code to remove to make it passive or not fight
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
- Generating Ores
mod_test
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map;
import java.awt.Color;
public class mod_test extends BaseMod
{
public static final Block waterore = new Blockwaterore(160, 0).setStepSound(Block.soundStoneFootstep).setBlockName("waterore").setHardness(4.5F).setResistance(5F).setLightValue(0F).setCreativeTab(CreativeTabs.tabBlock);;
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 5; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(waterore.blockID, 7)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public void load()
{
waterore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mymod/waterore.png");
ModLoader.addName(waterore, "Water Ore");
ModLoader.registerBlock(waterore);
}
public String getVersion()
{
return "1.4.4";
}
}
Blockwaterore
package net.minecraft.src;
import java.util.Random;
public class Blockwaterore extends Block
{
public Blockwaterore(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_test.waterore.blockID;
}
}
All you are doing is making a block but adding this code
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 5; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(waterore.blockID, 7)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
- TNT
- Spawning A Mob Like A Snow Golem Or Iron Golem
mod_test
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map;
import java.awt.Color;
public class mod_test extends BaseMod
{
public static final Block superstone = new Blockchippedstone(160, 0).setStepSound(Block.soundStoneFootstep).setBlockName("waterore").setHardness(4.5F).setResistance(5F).setLightValue(0F).setCreativeTab(CreativeTabs.tabBlock);;
public void load()
{
superstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mymod/waterore.png");
ModLoader.addName(superstone, "Super Stone");
ModLoader.registerBlock(superstone);
}
public String getVersion()
{
return "1.4.4";
}
}
Blocksuperstone
package net.minecraft.src;
import java.util.Random;
public class Blocksuperstone extends Block
{
public Blocksuperstone(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_test.superstone.blockID;
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
if (par1World.getBlockId(par2, par3 - 1, par4) == Block.obsidian.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.obsidian.blockID)
{
if (!par1World.isRemote)
{
par1World.setBlock(par2, par3, par4, 0);
par1World.setBlock(par2, par3 - 1, par4, 0);
par1World.setBlock(par2, par3 - 2, par4, 0);
EntityKnight var9 = new EntityKnight(par1World);
var9.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F);
par1World.spawnEntityInWorld(var9);
par1World.notifyBlockChange(par2, par3, par4, 0);
par1World.notifyBlockChange(par2, par3 - 1, par4, 0);
par1World.notifyBlockChange(par2, par3 - 2, par4, 0);
}
for (int var10 = 0; var10 < 120; ++var10)
{
par1World.spawnParticle("fireball", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 2.5D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
}
}
}
}
so for this code that I used for example you have to place down obsidian then another on top and then the super stone on the top. If you want to change the two bottom blocks edit this line of code.
If you have an error report it in a reply like this:I have an error here it is the error is in red.
package net.minecraft.src;
import java.util.Random;
public class Blockorefuocodirath extends Block
{
public Blockorefuocodirath(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_wau.orefuocodirath.blockID;
}
}
}
This is how you post your error for your mod. I will quote your error post and give you a solution. If I can't get you an answer don't keep asking someone else who goes to this post might be able to get an answer.
Hey guys im making a mod from the avengers and im making loki's tesseractsceptor(no copy please) and i just started making mods 3 days ago. I have made everything like speedblocks and new tools but when it comes to projectiles its so confusing. Im trying to make the sceptor shoot tesseract charges. I have made the render, the item, and the mod_xxxxx for it. But when i add this to my mod_xxxxx it doesnt load minecraft but when i take it away it works but when i shoot the charge it just gives the white block:
public void AddRenderer(Map map)
{
map.put(EntityTesseractCharge.class, new RenderTesseractCharge());
}
i checked everything i could and i did all the textures and all the .png correctly but it doesnt work when i add the code but it works when i take it away but gives a white block PLEASE help meeee
Think this should be the last part, in my Mod_Modname , Basemod cant be resolved to a type; and Modloader can't be resolved. What do I do with mod loader exactly? allI have is alot of .class files in it, missing something maby?
in my mod
i have done every thing correctly (i think)
I Renamed Everything To My Files
when i load the minecraft client it works
i load up a world it works
when i spawn my mob it works
only one problem
its a knight model
in the code there is no refrence to a model file or render file
why is this?
my turtle mob is just a dert head floating in the air
how do i fix this?
in my mod
i have done every thing correctly (i think)
I Renamed Everything To My Files
when i load the minecraft client it works
i load up a world it works
when i spawn my mob it works
only one problem
its a knight model
in the code there is no refrence to a model file or render file
why is this?
my turtle mob is just a dert head floating in the air
how do i fix this?
Do you have modlaoder istalled to check you have to look for basemod.class if you dont have that you dont have modloader
Think this should be the last part, in my Mod_Modname , Basemod cant be resolved to a type; and Modloader can't be resolved. What do I do with mod loader exactly? allI have is alot of .class files in it, missing something maby?
Tell me if some code doesn't work please!
- Setting Up Your Mod
mod_test
Okay at the top it says mod_test you can change this to anything like mod_fire or mod_good. Also the mod_test will be the name of your .java file. So if you changed you mod_test to mod_swordcraft the name of the .java file this is in should be mod_swordcraft.java that's it! If you need help with this reply for help! For all tutorials you can make the change the .java class name if you do it correctly.
mod_test
Blockchippedstone
You can change the Hardness or any of the other things near it if it has a (5F) or something F. You can change the 5F to a 3F if you want to.
mod_test
Itemwateringot
mod_test
EntityKnight
All of it is straight forward but the texture will have to be like a skin you upload for your minecraft account. On mod_test it says 20, 1, 1 on the addspawn line. The 20 means the rarity 20 is pretty normal. The first one means the minimum amount you can find spawn together and the third one is the maximum amount you can see in a group. If you want it to be a creature like a pig change the ModLoader.addSpawn("Knight", 20, 1, 1, EnumCreatureType.creature); to creature (already is creature). If you want it to be like a zombie change it to monster. If you want it to be a creature and spawn in water only change it to waterCreature. If you dont want you'r mob to fight back remove this line of code in the Entity****.java file. Here is the code to remove to make it passive or not fight
mod_test
Blockwaterore
All you are doing is making a block but adding this code
- Spawning A Mob Like A Snow Golem Or Iron Golem
mod_test
Blocksuperstone
so for this code that I used for example you have to place down obsidian then another on top and then the super stone on the top. If you want to change the two bottom blocks edit this line of code.
This will summon the EntityKnight
If you have an error report it in a reply like this:I have an error here it is the error is in red.
package net.minecraft.src;
import java.util.Random;
public class Blockorefuocodirath extends Block
{
public Blockorefuocodirath(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_wau.orefuocodirath.blockID;
}
}
}
This is how you post your error for your mod. I will quote your error post and give you a solution. If I can't get you an answer don't keep asking someone else who goes to this post might be able to get an answer.
I really appreciate a reputation plus!
public void AddRenderer(Map map)
{
map.put(EntityTesseractCharge.class, new RenderTesseractCharge());
}
i checked everything i could and i did all the textures and all the .png correctly but it doesnt work when i add the code but it works when i take it away but gives a white block PLEASE help meeee
Bc I hate forge...
And how do i make it wield an item i made for my mod?
when it has the item dropped it can drop nothing or something
and holding an item im still working on it doesnt seam to work on this version of modloader
and this is modloader
i have done every thing correctly (i think)
I Renamed Everything To My Files
when i load the minecraft client it works
i load up a world it works
when i spawn my mob it works
only one problem
its a knight model
in the code there is no refrence to a model file or render file
why is this?
my turtle mob is just a dert head floating in the air
how do i fix this?
Thanks I see but is it just Iron Golems or is it also Snow Golems too?
also, how do I change the color of the spawn egg? I want it to have a Red Shell with darker red spots on it
Subscribe to my YouTube Channel
Follow me on Twitter
The "0x000000" is where you can put in a Hex code (Example; FF0000 = Red)
Subscribe to my YouTube Channel
Follow me on Twitter