ALL BLOCKS ARE OUTDATED I WILL UPDATE THEM SOON SO DONT WORRY
Welcome, my username is Creepakiller987 (MegaDman98) and I'm going to be showing you some very basic steps in order to start modding. My coding series has started on 1.3.2 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!
public int func_82803_g()
{
return this.toolMaterial.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block.blockID == Block.web.blockID)
{
return 15.0F;
}
else
{
Material var3 = par2Block.blockMaterial;
return var3 != Material.plants && var3 != Material.vine && var3 != Material.field_76261_t && var3 != Material.leaves && var3 != Material.pumpkin ? 1.0F : 1.5F;
}
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
{
if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
{
par1ItemStack.damageItem(2, par7EntityLiving);
}
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return this.weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 72000;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return this.toolMaterial.getEnchantability();
}
public String func_77825_f()
{
return this.toolMaterial.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
public static final
[spoiler]
public static final Item NAMESword = new ItemSword(3077, EnumToolMaterial.GOLD).setItemName("AnythingHere");
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
Public Static Final
[spoiler]
public static final Item NAMEPick = new ItemPickaxe2(2102, EnumToolMaterial2.GOLD).setItemName("Whatever");
[/spoiler]
Public Void Load
[spoiler]
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
});
[/spoiler]
[/spoiler]
ItemTool2
[spoiler]
package net.minecraft.src;
public class ItemTool2 extends Item
{
/** Array of blocks the tool has extra effect against. */
private Block[] blocksEffectiveAgainst;
protected float efficiencyOnProperMaterial = 4.0F;
/** Damage versus entities. */
private int damageVsEntity;
/** The material this tool is made from. */
protected EnumToolMaterial2 toolMaterial;
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
for (int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3)
{
if (this.blocksEffectiveAgainst[var3] == par2Block)
{
return this.efficiencyOnProperMaterial;
}
}
return 1.0F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(2, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
{
if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
{
par1ItemStack.damageItem(1, par7EntityLiving);
}
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return this.damageVsEntity;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return this.toolMaterial.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return this.toolMaterial.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
[/spoiler]
ItemPickaxe2
[spoiler]
package net.minecraft.src;
public class ItemPickaxe2 extends ItemTool2
{
/** an array of the blocks this pickaxe is effective against */
private static Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered};
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
Public Static Final
[spoiler]
public static final Item NAMEAxe = new ItemAxe(2096, EnumToolMaterial.GOLD).setItemName("whatever");
public class ItemAxe2 extends ItemTool2
{
/** an array of the blocks this axe is effective against */
private static Block[] blocksEffectiveAgainst = new Block[] {Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern};
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
public static final
[spoiler]
public static final Item NAMESpade = new ItemSpade(2099, EnumToolMaterial.GOLD).setItemName("Whatever");
[/spoiler]
public void load
[spoiler]
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
});
[/spoiler]
ItemSpade2
[spoiler]
package net.minecraft.src;
public class ItemSpade2 extends ItemTool2
{
/** an array of the blocks this spade is effective against */
private static Block[] blocksEffectiveAgainst = new Block[] {Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium};
/** * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) */ private final int harvestLevel;
/** * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) */ private final int maxUses;
/** * The strength of this tool material against blocks which it is effective against. */ private final float efficiencyOnProperMaterial;
/** Damage versus entities. */ private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */ private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7) { this.harvestLevel = par3; this.maxUses = par4; this.efficiencyOnProperMaterial = par5; this.damageVsEntity = par6; this.enchantability = par7; }
/** * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) */ public int getMaxUses() { return this.maxUses; }
/** * The strength of this tool material against blocks which it is effective against. */ public float getEfficiencyOnProperMaterial() { return this.efficiencyOnProperMaterial; }
/** * Damage versus entities. */ public int getDamageVsEntity() { return this.damageVsEntity; }
/** * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) */ public int getHarvestLevel() { return this.harvestLevel; }
/** * Return the natural enchantability factor of the material. */ public int getEnchantability() { return this.enchantability; }
/** * Return the crafting material for this tool material, used to determine the item that can be used to repair a tool * with an anvil */ public int getToolCraftingMaterial() { return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0)))); } }
[/spoiler]
public static final
[spoiler]
public static final Item NAMEHoe = new ItemHoe(2107, EnumToolMaterial.GOLD).setItemName("Whatever");
[/spoiler]
public void load
[spoiler]
NAMEHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png");
ModLoader.addName(NAMEHoe, "NAME Hoe");
ModLoader.addRecipe(new ItemStack(NAMEHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Block.dirt
});
[/spoiler]
ItemHoe2
[spoiler]
package net.minecraft.src;
public class ItemHoe2 extends Item
{
protected EnumToolMaterial2 theToolMaterial;
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else
{
int var11 = par3World.getBlockId(par4, par5, par6);
int var12 = par3World.getBlockId(par4, par5 + 1, par6);
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"));
public static final Block NAMEBlock = new BlockNAME(151, 0).setHardness(6F).setResistance(7.0F).setBlockName("whatever");
[/spoiler]
public void load
[spoiler]
ModLoader.registerBlock(NAMEBlock);
NAMEBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png" , "/items/pic.png");
ModLoader.addName(NAMEBlock, "In Game Name Ore");
[/spoiler]
PUT THIS ABOVE THE PUBLIC VOID LOAD
[spoiler]
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);
}
}
public class BlockNAME extends Block
{
protected BlockNAME(int i, int j)
{
super(i, j, Material.iron);
}
//add this if want it to have a rare drop
//public int dropRareDrop(int par1, Random par2Random, int par3)
//{
//return mod_NAME.ITEM.shiftedIndex;
//}
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";
}
}
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;
}
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));
}
}
[/spoiler]
IF USING SAME CLASS
[spoiler]
THIS GOES WITH THE PAKAGE NET.MINECRTAFT.SRC
[spoiler]
import java.awt.Color;
import java.util.Map;
[/spoiler]
PUBLIC VOID LOAD NOT PUBLIC STATIC FINAL
[spoiler]
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
[/spoiler]
ADD THIS PUBLIC VOID UNDER THE PUBLIC VOID LOAD
[spoiler]
public void addRenderer(Map var1)
{
var1.put(EntityNAME.class, new RenderLiving(new ModelNAME(),.5f));
}
public static final Achievement achievementNAME = new Achievement(5400, "achievementNAME", 10, 9, Item.sugar, null).setSpecial().setIndependent().registerAchievement();
//if second
public static final Achievement achievementNAME = new Achievement(5401, "achievementNAME", 10, 12, Item.bone, achievementTHATCONNECTSTO).registerAchievement();
[/spoiler]
public void load
[spoiler]
//FIRST ACHIEVMENT
ModLoader.addAchievementDesc(achievementNAME, "WHAT U WANT IT TO SAY", "HOW YOU GET IT");
//SECOND ACHIEVMENT
ModLoader.addAchievementDesc(achievementNAME, "WAT U WANT IT SO SAY", "HOW U GET IT");
public class BlockNAME extends BlockSand
{
public BlockNAME(int i, int j)
{
super(i, j, Material.wood);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public static boolean fallInstantly = false
public int idDropped(int i, Random random, int j)
{
return mod_NAME.BLOCK.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
[/spoiler]
[/spoiler]
[/spoiler]
17. Adding Fuel
[spoiler]
Schematics
[spoiler]
FOR THE ITEM NAME, BLOCK NAME AND ALL THAT HAVE TO DO WITH THAT THOSE SCHEMATICS ARE IN THE FIRST CUPPLE OF MY TUTORIALS THE SCHEMATICS FOR THEM ARE IN #2 FOR ITEM AND #3 FOR THE BLOCK
UNDER THE PUBLIC VOID
[spoiler]
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;
}
[/spoiler]
[/spoiler] Pics
[spoiler]
Planned features for Modloader: ( taking requests )
Crops
New Biomes
New Furnace
New Dimentions
New GUI
Sharpless Crafting
Ore Generation in Nether / End
Plants
Particles
Structure Generation
New Bow
Enchantments
AudioMod
Mobs holding Items
Music Disc
Trees/ Sapling
Unbreakable Blocks
Mining ores with specific Pickaxe
Mobs spawning in specific biomes
Throwable Items
Description on Items
New Torches
Glowable Blocks
Food adds player effects (Speed, Haste, Etc)
Mobs shooting snowballs, arrows, etc.
Really helpful because I've never made a mod with fore in my hole entire life but this has really helped me. The video is some areas is a bit hard to understand though that's it though for me.
Really helpful because I've never made a mod with fore in my hole entire life but this has really helped me. The video is some areas is a bit hard to understand though that's it though for me.
but you still liked it and could you plz check to see if the links in adfly work? i cant cuz im loged in and it gets kida screwy when your loged in
I made it replace other generation like clay, but I can't seem to be able to use the same code, even with changing a few things here and their so that it appears different to the original, I tried to use the same format of code for 1.3.1 but they must have changed the format... again.
I made it replace other generation like clay, but I can't seem to be able to use the same code, even with changing a few things here and their so that it appears different to the original, I tried to use the same format of code for 1.3.1 but they must have changed the format... again.
For your next tutorial can you tell me how to add a item that glows in your mine hand.thx buddy, also Mods rule
yaa that is close i am doing mobs right now but soon ill be showing how to make a GLOWING blok but an item that glows in your hand has a little bit of a complex code and we are just scratching the serface of modding but ill pt it in my list!
Can you make a tutorial on how to do a update notification? Like when the person enters the game it checks against a xml file somewhere and compares versions and if there is a new version it tells the player.
Waahhh! You're taking requests right? Then... PLEASE ADD A TUTORIAL ABOUT GIVING AN ARMOR AN ENCHANTMENT(Like if you equip the armor or armor set, you are able to breathe underwater, generate snow wherever you go, be able to see clearly underwater, increased movement speed on land, increased jump height, unbreakable armor, invisible, those stuff) PLEASEEE! I've been looking high and low for this sort of tutorial and I have never found one that works for 1.4.7 yet! DX Please help ;o;
Waahhh! You're taking requests right? Then... PLEASE ADD A TUTORIAL ABOUT GIVING AN ARMOR AN ENCHANTMENT(Like if you equip the armor or armor set, you are able to breathe underwater, generate snow wherever you go, be able to see clearly underwater, increased movement speed on land, increased jump height, unbreakable armor, invisible, those stuff) PLEASEEE! I've been looking high and low for this sort of tutorial and I have never found one that works for 1.4.7 yet! DX Please help ;o;
ya sure i will try but that hasnt worked for me also XD but i think i know how to but ill have to try but it is definetly on my list ok
-creepakiller987(MegaDman98)
This Is A WIP Forum Post It Will Be Updated Every 2 Days
DONATE For More Tutorials (TO SUPPORT CHANNEL): DONATION : ===> https://www.paypal.c...G.gif:NonHosted
ALL BLOCKS ARE OUTDATED I WILL UPDATE THEM SOON SO DONT WORRY
Welcome, my username is Creepakiller987 (MegaDman98) and I'm going to be showing you some very basic steps in order to start modding. My coding series has started on 1.3.2 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!
My Youtube is here: http://www.youtube.c...98?feature=mhee
Videos and SRC codes!
1. Setting Up MCP, Eclipse, And JavaJDK
[spoiler]
Links:
[spoiler]
JavaJDK: http://www.oracle.co...ds-1880260.html
(if it doesnt work just copy the link and paste it in the web)
Eclipse: http://www.eclipse.org/downloads/
ModLoader
[spoiler]
1.4.6/1.4.7: http://adf.ly/H5OAB
1.5 : http://adf.ly/Kyjv4
[/spoiler]
MCP
[spoiler]
1.4.6/1.4.7: http://adf.ly/H5OkU
1.5: http://adf.ly/Kygum
[/spoiler]
[/spoiler]
[/spoiler]
2. Making A Basic Item
[spoiler]
Schematics
[spoiler]
Mod_NAME
[spoiler]
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");
//add if want to be craftted
//ModLoader.addRecipe(new ItemStack (NAME,1), new Object []
//{
//" ", " ", " ",
//'',mod_NAME.ITEM
//});
}
public String getVersion()
{
return "3.14159265";
}
}
[/spoiler]
ItemNAME
[spoiler]
package net.minecraft.src;
import java.util.Random;
public class ItemNAME extends Item
{
public ItemNAME(int i)
{
super(i);
maxStackSize = 64;
this.setCreativeTab(CreativeTabs.tabNAME);
}
public String Version()
{
return "3.14159265";
}
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
Blue Ingot
[/spoiler]
Links
[spoiler]
GIMP: http://www.gimp.org/downloads/
[/spoiler]
[/spoiler]
3. Adding A Basic Block
[spoiler]
Schematics
[spoiler]
mod_NAME
[spoiler]
package net.minecraft.src;
import java.util.Random;
public class mod_NAME extends BaseMod
{
public static final Block NAMEBlock = new BlockNAME(151, 0).setHardness(6F).setResistance(7.0F).setBlockName("whatever");
//public static int NAME;
//public static int NAME;
public void load()
{
NAMEblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/items/pic.png");
ModLoader.registerBlock(NAMEblock);
ModLoader.addName(NAMEblock, "In-Game-Name Block");
//NAME = ModLoader.addOverride("/terrain.png", "/items/pic.png");
//NAME = ModLoader.addOverride("/terrain.png", "/items/pic.png");
}
public String getVersion()
{
return "3.14159265";
}
}
[/spoiler]
BlockNAME
[spoiler]
package net.minecraft.src;
import java.util.Random;
public class BlockNAME extends Block
{
public BlockNAME(int i, int j)
{
super(i, j, Material.wood);
this.setCreativeTab(CreativeTabs.tabBlock);
}
// ADD THIS IF YOU WANT TO HAVE DIFFERENT TEXTURES BUT DELETE THE //)
// THIS IS THE INT'S FOR EXAMPLE MY INTS WHERE LEFTSIDE AND RIGHT SIDE
// public int getBlockTextureFromSideAndMetadata(int i, int j)
// {
// if(i == 0)
// return mod_NAME.NAMEOFINT;
// if(i == 1)
// return mod_NAME.NAMEOFINT;
// if(i == 2)
// return mod_NAME.NAMEOFINT;
// if(i == 3)
// return mod_NAME.NAMEOFINT;
// if(i == 4)
// return mod_NAME.NAMEOFINT;
// if(i == 5)
// return mod_NAME.NAMEOFINT;
// if(j == 1)
// {
// return 116;
// }
// return j != 2 ? 20 : 117;
// }}
public int idDropped(int i, Random random, int j)
{
return mod_NAME.BLOCK.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
[/spoiler]
[/spoiler]
Links
[spoiler]
GIMP: http://www.gimp.org/downloads/
[/spoiler]
Pics
[spoiler]
Blue Block (will be updated!)
[/spoiler]
[/spoiler]
4. Adding A Sword
[spoiler]
Schematics
[spoiler]
ItemSword2
[spoiler]
package net.minecraft.src;
public class ItemSword2 extends Item
{
private int weaponDamage;
private final EnumToolMaterial2 toolMaterial;
public ItemSword2(int par1, EnumToolMaterial2 par2EnumToolMaterial2)
{
super(par1);
this.toolMaterial = par2EnumToolMaterial2;
this.maxStackSize = 1;
this.setMaxDamage(par2EnumToolMaterial2.getMaxUses());
this.setCreativeTab(CreativeTabs.tabCombat);
this.weaponDamage = 4 + par2EnumToolMaterial2.getDamageVsEntity();
}
public int func_82803_g()
{
return this.toolMaterial.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block.blockID == Block.web.blockID)
{
return 15.0F;
}
else
{
Material var3 = par2Block.blockMaterial;
return var3 != Material.plants && var3 != Material.vine && var3 != Material.field_76261_t && var3 != Material.leaves && var3 != Material.pumpkin ? 1.0F : 1.5F;
}
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
{
if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
{
par1ItemStack.damageItem(2, par7EntityLiving);
}
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return this.weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 72000;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return this.toolMaterial.getEnchantability();
}
public String func_77825_f()
{
return this.toolMaterial.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
[/spoiler]
EnumToolMaterial2
[spoiler]
package net.minecraft.src;
public enum EnumToolMaterial2
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
public static final
[spoiler]
public static final Item NAMESword = new ItemSword(3077, EnumToolMaterial.GOLD).setItemName("AnythingHere");
[/spoiler]
public void load
[spoiler]
NAMESword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/sword.png");
ModLoader.addName(NAMESword, "NAME Sword");
ModLoader.addRecipe(new ItemStack(NAMESword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Block.dirt
});
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
5. Making A PickAxe
[spoiler]
Schematics
[spoiler]
EnumToolMaterial2
[spoiler]
package net.minecraft.src;
public enum EnumToolMaterial2
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
Public Static Final
[spoiler]
public static final Item NAMEPick = new ItemPickaxe2(2102, EnumToolMaterial2.GOLD).setItemName("Whatever");
[/spoiler]
Public Void Load
[spoiler]
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
});
[/spoiler]
[/spoiler]
ItemTool2
[spoiler]
package net.minecraft.src;
public class ItemTool2 extends Item
{
/** Array of blocks the tool has extra effect against. */
private Block[] blocksEffectiveAgainst;
protected float efficiencyOnProperMaterial = 4.0F;
/** Damage versus entities. */
private int damageVsEntity;
/** The material this tool is made from. */
protected EnumToolMaterial2 toolMaterial;
protected ItemTool2(int par1, int par2, EnumToolMaterial2 par3EnumToolMaterial2, Block[] par4ArrayOfBlock)
{
super(par1);
this.toolMaterial = par3EnumToolMaterial2;
this.blocksEffectiveAgainst = par4ArrayOfBlock;
this.maxStackSize = 1;
this.setMaxDamage(par3EnumToolMaterial2.getMaxUses());
this.efficiencyOnProperMaterial = par3EnumToolMaterial2.getEfficiencyOnProperMaterial();
this.damageVsEntity = par2 + par3EnumToolMaterial2.getDamageVsEntity();
this.setCreativeTab(CreativeTabs.tabTools);
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
for (int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3)
{
if (this.blocksEffectiveAgainst[var3] == par2Block)
{
return this.efficiencyOnProperMaterial;
}
}
return 1.0F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(2, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
{
if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
{
par1ItemStack.damageItem(1, par7EntityLiving);
}
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return this.damageVsEntity;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return this.toolMaterial.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return this.toolMaterial.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
[/spoiler]
ItemPickaxe2
[spoiler]
package net.minecraft.src;
public class ItemPickaxe2 extends ItemTool2
{
/** an array of the blocks this pickaxe is effective against */
private static Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered};
protected ItemPickaxe2(int par1, EnumToolMaterial2 par2EnumToolMaterial2)
{
super(par1, 2, par2EnumToolMaterial2, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockSteel && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.anvil || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block);
}
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
6. Making A Axe
[spoiler]
Schematics
[spoiler]
EnumToolMaterial2
[spoiler]
package net.minecraft.src;
public enum EnumToolMaterial2
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
Public Static Final
[spoiler]
public static final Item NAMEAxe = new ItemAxe(2096, EnumToolMaterial.GOLD).setItemName("whatever");
[/spoiler]
Public Void Load
[spoiler]
NAMEAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png");
ModLoader.addName(NAMEAxe, "NAME Axe");
ModLoader.addRecipe(new ItemStack(NAMEAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Block.dirt
});
[/spoiler]
ItemAxe2
[spoiler]
package net.minecraft.src;
public class ItemAxe2 extends ItemTool2
{
/** an array of the blocks this axe is effective against */
private static Block[] blocksEffectiveAgainst = new Block[] {Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern};
protected ItemAxe2(int par1, EnumToolMaterial2 par2EnumToolMaterial)
{
super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst);
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block != null && (par2Block.blockMaterial == Material.wood || par2Block.blockMaterial == Material.plants || par2Block.blockMaterial == Material.vine) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block);
}
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
7. Making A Shovel
[spoiler]
Schematics
[spoiler]
EnumToolMaterial2
[spoiler]
package net.minecraft.src;
public enum EnumToolMaterial2
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
public static final
[spoiler]
public static final Item NAMESpade = new ItemSpade(2099, EnumToolMaterial.GOLD).setItemName("Whatever");
[/spoiler]
public void load
[spoiler]
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
});
[/spoiler]
ItemSpade2
[spoiler]
package net.minecraft.src;
public class ItemSpade2 extends ItemTool2
{
/** an array of the blocks this spade is effective against */
private static Block[] blocksEffectiveAgainst = new Block[] {Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium};
public ItemSpade2(int par1, EnumToolMaterial2 par2EnumToolMaterial)
{
super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block == Block.snow ? true : par1Block == Block.blockSnow;
}
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
8. Making A Hoe
[spoiler]
Schematics
[spoiler]
EnumToolMaterial2
[spoiler]
package net.minecraft.src;
public enum EnumToolMaterial2
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial2(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
[/spoiler]
public static final
[spoiler]
public static final Item NAMEHoe = new ItemHoe(2107, EnumToolMaterial.GOLD).setItemName("Whatever");
[/spoiler]
public void load
[spoiler]
NAMEHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png");
ModLoader.addName(NAMEHoe, "NAME Hoe");
ModLoader.addRecipe(new ItemStack(NAMEHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Block.dirt
});
[/spoiler]
ItemHoe2
[spoiler]
package net.minecraft.src;
public class ItemHoe2 extends Item
{
protected EnumToolMaterial2 theToolMaterial;
public ItemHoe2(int par1, EnumToolMaterial2 par2EnumToolMaterial)
{
super(par1);
this.theToolMaterial = par2EnumToolMaterial;
this.maxStackSize = 1;
this.setMaxDamage(par2EnumToolMaterial.getMaxUses());
this.setCreativeTab(CreativeTabs.tabTools);
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else
{
int var11 = par3World.getBlockId(par4, par5, par6);
int var12 = par3World.getBlockId(par4, par5 + 1, par6);
if ((par7 == 0 || var12 != 0 || var11 != Block.grass.blockID) && var11 != Block.dirt.blockID)
{
return false;
}
else
{
Block var13 = Block.tilledField;
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F);
if (par3World.isRemote)
{
return true;
}
else
{
par3World.setBlockWithNotify(par4, par5, par6, var13.blockID);
par1ItemStack.damageItem(1, par2EntityPlayer);
return true;
}
}
}
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
public String func_77842_f()
{
return this.theToolMaterial.toString();
}
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
9. Adding Food
[spoiler]
Schematics
[spoiler]
public static final
[spoiler]
public static final Item nameHere = new ItemFood(5000, 6, 1F, true).setItemName("anyNameHere");
[/spoiler]
public void load
[spoiler]
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
});
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
10. Adding Armor
[spoiler]
Schematics
[spoiler]
public static final
[spoiler]
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"));
[/spoiler]
public void load
[spoiler]
NAMEBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png");
ModLoader.addName(NAMEBody, "In-Game-NAME Chestplate");
ModLoader.addRecipe(new ItemStack(NAMEBody,1), new Object[]{
"* *", "***", "***", Character.valueOf('*'), Block.dirt});
// Helmet Armor
NAMEHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png");
ModLoader.addName(NAMEHelmet, "In-Game-Name Helmet");
ModLoader.addRecipe(new ItemStack(NAMEHelmet,1), new Object[]{
"***", "* *", Character.valueOf('*'), Block.dirt});
// Pants Armor
NAMEPants.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png");
ModLoader.addName(NAMEPants, "In-game-Name Leggings");
ModLoader.addRecipe(new ItemStack(NAMEPants,1), new Object[]{
"***", "* *", "* *", Character.valueOf('*'), Block.dirt});
// Boots Armor
NAMEBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png");
ModLoader.addName(NAMEBoots, "In-Game-Name Boots");
ModLoader.addRecipe(new ItemStack(NAMEBoots,1), new Object[]{
"* *", "* *", Character.valueOf('*'), Block.dirt});
ModLoader.addArmor("Name-Of-Armor");
[/spoiler]
THIS GOES UNDER THE PUBLIC VOID LOAD
[spoiler]
public String Version()
{
return "1.4.2";
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
Links
[spoiler]
GIMP: http://www.gimp.org/downloads/
[/spoiler]
[/spoiler]
11. Ore Generation
[spoiler]
Schematics
[spoiler]
public static final
[spoiler]
public static final Block NAMEBlock = new BlockNAME(151, 0).setHardness(6F).setResistance(7.0F).setBlockName("whatever");
[/spoiler]
public void load
[spoiler]
ModLoader.registerBlock(NAMEBlock);
NAMEBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png" , "/items/pic.png");
ModLoader.addName(NAMEBlock, "In Game Name Ore");
[/spoiler]
PUT THIS ABOVE THE PUBLIC VOID LOAD
[spoiler]
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);
}
}
[/spoiler]
BlockNAME
[spoiler]
package net.minecraft.src;
import java.util.Random;
public class BlockNAME extends Block
{
protected BlockNAME(int i, int j)
{
super(i, j, Material.iron);
}
//add this if want it to have a rare drop
//public int dropRareDrop(int par1, Random par2Random, int par3)
//{
//return mod_NAME.ITEM.shiftedIndex;
//}
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";
}
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
12. Exporting Your Mod
[spoiler]
Steps
[spoiler]
1. decompile
2. getchangedsrc
3. reobfuscate
4. go into the reobf folder and get all the classes
5. make a new folder and name it what you want your mod to be called
6. paste all the classes into that folder
7. get ALL the picture folders from the bin
8 paste the picture folders into the same folder as the clases
9. compress the folder
10. BE HAPPY
[/spoiler]
Installation
[spoiler]
1. get latest version of mod loader and put it in your minecraft.jar
2. paste EVERYTHING from your mod foler into the minecraft.jar also
3. UR DONE NOW GTFO (JK!)
[/spoiler]
[/spoiler]
13. Making a Mob
[spoiler]
Part 1 Modeling
[spoiler]
You will need Internet Explorer to right-click the "Download/Website" link on Techne's forum to save it as an application.
( Watch my Video )
"http://www.minecraftforum.net/topic/200676-modeler-techne-looking-for-help/%27%5DDownload"">http://www.minecraft.../'" target="" data-ensure-absolute>Download Techne Here
My Turtle Model (NEED TECHNE): http://adf.ly/IlY16
[/spoiler]
Part 2 Texturing
[spoiler]
Pics
[spoiler]
ORIGINAL
:
NICK WILL TEXTURE: COMMING SOON
[/spoiler]
[/spoiler]
Part 3 Coding
[spoiler]
Schematics
[spoiler]
EntityNAME
[spoiler]
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;
}
}
[/spoiler]
ModelNAME
[spoiler]
(PUT IN THE STUFF FROM UR JAVA FILE)
THIS IS FOR THE LEG MOVEMENT AND ARM MOVMENT EXPERIMENT WITH IT
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
leg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
leg2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.0F * f1;
arm.rotateAngleZ = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
arm2.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.0F * f1;
}
[/spoiler]
IF USING A DIFFERENT CLASS
[spoiler]
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));
}
}
[/spoiler]
IF USING SAME CLASS
[spoiler]
THIS GOES WITH THE PAKAGE NET.MINECRTAFT.SRC
[spoiler]
import java.awt.Color;
import java.util.Map;
[/spoiler]
PUBLIC VOID LOAD NOT PUBLIC STATIC FINAL
[spoiler]
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
[/spoiler]
ADD THIS PUBLIC VOID UNDER THE PUBLIC VOID LOAD
[spoiler]
public void addRenderer(Map var1)
{
var1.put(EntityNAME.class, new RenderLiving(new ModelNAME(),.5f));
}
[/spoiler]
[/spoiler]
[/spoiler]
[/spoiler]
[/spoiler]
14. Adding Achievements
[spoiler]
Schematics
[spoiler]
public static final
[spoiler]
//if fist achevment
public static final Achievement achievementNAME = new Achievement(5400, "achievementNAME", 10, 9, Item.sugar, null).setSpecial().setIndependent().registerAchievement();
//if second
public static final Achievement achievementNAME = new Achievement(5401, "achievementNAME", 10, 12, Item.bone, achievementTHATCONNECTSTO).registerAchievement();
[/spoiler]
public void load
[spoiler]
//FIRST ACHIEVMENT
ModLoader.addAchievementDesc(achievementNAME, "WHAT U WANT IT TO SAY", "HOW YOU GET IT");
//SECOND ACHIEVMENT
ModLoader.addAchievementDesc(achievementNAME, "WAT U WANT IT SO SAY", "HOW U GET IT");
[/spoiler]
UNDER THE PUBLIC VOID LOAD
[spoiler]
//FIRST ACHIVMENT
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory)
{
if(itemstack.itemID == mod_minecraft.NAME.shiftedIndex)
{
entityplayer.addStat(achievementNAME, 1);
}
}
//SECOND ACHIVMENT
public void onItemPickup(EntityPlayer entityplayer, ItemStack itemstack)
{
if(itemstack.itemID == mod_minecraft.NAME.shiftedIndex)
{
entityplayer.addStat(achievementNAME, 2);
}
}
[/spoiler]
[/spoiler]
[/spoiler]
15. Smelting Code
[spoiler]
Schematics
[spoiler]
public void load
[spoiler]
//IF SMELTING BLOCKS TO BLOCKS
ModLoader.addSmelting(yourBlock.blockID, new ItemStack(yourSmeltedBlock, 1), 1.0F);
//IF SMELTING ITEM TO ITEM
ModLoader.addSmelting(yourItem.shiftedIndex, new ItemStack(yourSmeltedItem, 1), 1.0F);
[/spoiler]
[/spoiler]
[/spoiler]
16. Block Affected By Gravity (Like Sand)
[spoiler]
Schematics
[spoiler]
Public Static Final
[spoiler]
public static final Block NAMEBlock = new BlockNAME(151, 0).setHardness(6F).setResistance(7.0F).setBlockName("whatever");
[/spoiler]
Pubic void load
[spoiler]
NAMEblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/items/pic.png");
ModLoader.registerBlock(NAMEblock);
ModLoader.addName(NAMEblock, "In-Game-Name Block");
[/spoiler]
BlockNAME
[spoiler]
package net.minecraft.src;
import java.util.Random;
public class BlockNAME extends BlockSand
{
public BlockNAME(int i, int j)
{
super(i, j, Material.wood);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public static boolean fallInstantly = false
public int idDropped(int i, Random random, int j)
{
return mod_NAME.BLOCK.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
[/spoiler]
[/spoiler]
[/spoiler]
17. Adding Fuel
[spoiler]
Schematics
[spoiler]
FOR THE ITEM NAME, BLOCK NAME AND ALL THAT HAVE TO DO WITH THAT THOSE SCHEMATICS ARE IN THE FIRST CUPPLE OF MY TUTORIALS THE SCHEMATICS FOR THEM ARE IN #2 FOR ITEM AND #3 FOR THE BLOCK
UNDER THE PUBLIC VOID
[spoiler]
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;
}
[/spoiler]
[/spoiler]
Pics
[spoiler]
[/spoiler]
[/spoiler]
Planned features for Modloader: ( taking requests )
Crops
New Biomes
New Furnace
New Dimentions
New GUI
Sharpless Crafting
Ore Generation in Nether / End
Plants
Particles
Structure Generation
New Bow
Enchantments
AudioMod
Mobs holding Items
Music Disc
Trees/ Sapling
Unbreakable Blocks
Mining ores with specific Pickaxe
Mobs spawning in specific biomes
Throwable Items
Description on Items
New Torches
Glowable Blocks
Food adds player effects (Speed, Haste, Etc)
Mobs shooting snowballs, arrows, etc.
If I've been helpful. Give an internet.
I made it replace other generation like clay, but I can't seem to be able to use the same code, even with changing a few things here and their so that it appears different to the original, I tried to use the same format of code for 1.3.1 but they must have changed the format... again.
Thank you,
IM BACK SO YA MORE TUTORIALS!
yaa that is close i am doing mobs right now but soon ill be showing how to make a GLOWING blok but an item that glows in your hand has a little bit of a complex code and we are just scratching the serface of modding but ill pt it in my list!
FOR EVEN MORE ROOM
ya sure i will try but that hasnt worked for me also XD but i think i know how to but ill have to try but it is definetly on my list ok
-creepakiller987(MegaDman98)