Just a quick question but with your tutorial on making a new custom mob... say i wanted to add two to the game instead of just one... what would i have to change/add to the code to make that happen? .-.
Hey there Scmowns, I watched your video of coding the mobs, I went to add spawn eggs for each of my mobs, but when I use the egg nothing happens, the egg disappears and nothing is spawned out of it, I followed what you said about the ID of mobs, but still I got nothing, could you please help me? Heres my mod_ file code:
package net.minecraft.src;
//Forum page can be found here. http://www.minecraftforum.net/topic/1598838-145-cybers-restructed-project-remastered-giratina-and-redux-swords/
//Pictures seen in the forum thread are of this project not made by me, make sure you download it: http://www.minecraftforum.net/topic/1532871-minecraft-cynder-and-spyro/
import java.util.Map;
import java.awt.Color;
import java.io.File;
import java.util.Random;
import net.minecraft.client.Minecraft;
//Mod created by CyberstormFromLU. http://www.minecraftforum.net/user/1206795-cyberfromlu/
//DISCLAIMER: This mod is totally random, things within this mod are all from insperation, nothing else.
public class mod_Giratina extends BaseMod
{ //Backbone of the mod file.
public static final Item WitherBow = (new ItemGiratinaOrb(1336)).setItemName("GriseousOrb");
public static final Item PureOrb = (new ItemPureOrb(1341)).setItemName("Pure Orb");
public static final Item Murakumon1 = (new ItemMurakumon(1337)).setItemName("Murakumon");
public static final Item HeavenSpear = (new ItemHeavenSpear(1338)).setItemName("Heaven Spear");
public static final Item GodBlade1 = (new ItemGodBlade(1339)).setItemName("Sword of the Late Hero (God's Blade)");
public static final Item HammerOfThor = (new ItemHammerOfGod(1340)).setItemName("Thor (Mighty God Hammer)");
public static final Item GiantKnife = (new ItemGiantKnife(1342)).setItemName("The Butcher (God's Giant Knife)");
public static final Item ShrivalSkull = (new ItemShrivalSkull(1343)).setItemName("Shrival Skull");
public static final Item DemonShield = (new ItemDemonShield(1344)).setItemName("Alldemonum Shield");
public static final Item DragonHalbard = (new ItemDragonHalbard(1345)).setItemName("Dragon Halbard (Spyro's Firey Rage)");
public static final Item CronoRiggers = (new ItemArmor(1346, EnumArmorMaterial.DIAMOND ,5,1 ).setItemName("Crono Riggers"));
static Achievement openInventory = AchievementList.openInventory;
public static final Enchantment spiralEnchantment = new meteroArrowEnchantment(36, 10, EnumEnchantmentType.weapon).setName("Metro Arrow");
public static final Achievement Murakumon = new Achievement(5000, "Murakumon", 4, 9, mod_Giratina.Murakumon1, openInventory).registerAchievement();
public static final Achievement HeavenSpear1 = new Achievement(5001, "Spear from Heaven", 4, 15, mod_Giratina.HeavenSpear, Murakumon).registerAchievement();
public static final Achievement GodBlade = new Achievement(5002, "Blade of God", 4, 18, mod_Giratina.GodBlade1, HeavenSpear1).registerAchievement();
public static final Achievement HammerThor = new Achievement(5003, "God's Final Weapon", 4, 20, mod_Giratina.HammerOfThor, GodBlade).registerAchievement();
public static DamageSource DeathDamage = (new DamageSource("Decapatate")).setMagicDamage().setFireDamage();
public static final Potion Death = (new Potion(21, true, 9000001)).setPotionName("Mark of Death").setEffectiveness(0.45D);
private static final Packet23VehicleSpawn Expression = null;
//Heres the config file, contains mob and item ids and achievement ids so you may change them to avoid conflict with other mods that use the same ids.
@MLProp(name = "GrisesousOrbID", info = "Default ID of the Griseous Orb")
public static int WitherBowID = 1336;
@MLProp(name = "MurakumonID", info = "Default ID of Murakumon")
public static int MurakumonID = 1337;
@MLProp(name = "HeavenSpearID", info = "Default ID of Heaven Spear")
public static int HeavenSpearID = 1338;
@MLProp(name = "GodBladeID", info = "Default ID of God Blade (Sword of the late Hero)")
public static int GodBladeID = 1339;
@MLProp(name = "GiratinaSnivyID", info = "ID used for Giratina/Snivy.")
public static int GiratinaSnivyID = -104;
@MLProp(name = "GiratinaOrbID", info = "ID used for EntityThrownGiratinaOrb.")
public static int GiratinaOrbID = -102;
@MLProp(name = "MurakumonAchievement", info = "ID used for Murakumon achievement")
public static int MurakumonAchievement = 5000;
@MLProp(name = "SpearFromHeaven", info = "ID used for Spear From Heaven achievement")
public static int SpearFromHeaven = 5001;
@MLProp(name = "BladeOfGodAchievement", info = "ID used for Blade of God achievement")
public static int BladeOfGodAchievement = 5002;
@MLProp(name = "DeathPotionEffect", info = "ID used for WIP Death potion effect.")
public static int DeathPotionEffect = 21;
@MLProp(name = "MetroArrowEnchantment", info = "ID used for Metro Arrow Enchantment.")
public static int MetroArrowEnchantment = 36;
@MLProp(name = "HammerOfThorID", info = "ID used for Thor Hammer")
public static int HammerOfThorID = 1340;
@MLProp(name = "MightyGodHammerAchievement", info = "ID used for Mighty God Hammer achievement")
public static int MightyGodHammerAchievement = 5003;
@MLProp(name = "WaskomsauseID", info = "ID used for Waskomsause.")
public static int WaskomsauseID = -103;
@MLProp(name = "ThrownPureOrbID", info = "ID used for EntityPureOrb.")
public static int ThrownPureOrbID = -100;
@MLProp(name = "PureOrbID", info = "Default ID of the Pure Orb")
public static int PureOrbID = 1341;
@MLProp(name = "KyuremID", info = "Default ID of Kyurem")
public static int KyuremID = -99;
@MLProp(name = "GiantKnifeID", info = "Default ID of The Butcher.")
public static int GiantKnifeID = 1342;
@MLProp(name = "ShrivalSkullID", info = "Default ID of Shrival Skull.")
public static int ShrivalSkullID = 1343;
@MLProp(name = "DemonShieldID", info = "Default ID of Demon Shield.")
public static int DemonShieldID = 1344;
@MLProp(name = "DragonHalbardID", info = "Default ID of the Dragon Halbard.")
public static int DragonHalbardID = 1345;
@MLProp(name = "ShrivalID", info = "Default ID of the Shrival.")
public static int ShrivalID = -98;
@MLProp(name = "ThrownSkullID", info = "Default ID of Thrown Skull Entitys.")
public static int ThrownSkullID = -97;
@MLProp(name = "SpyroID", info = "Default ID of Spyro.")
public static int SpyroID = -96;
@MLProp(name = "CynderID", info = "Default ID of Cynder.")
public static int CynderID = -95;
@MLProp(name = "CronoRiggersID", info = "Default ID of CronoRiggers.")
public static int CronoRiggersID = -95;
//Adds all mobs, items and achievements into the game.
public void load()
{
ModLoader.addName(WitherBow, "Griseous Orb");
ModLoader.addName(PureOrb, "Pure Orb");
ModLoader.addName(ShrivalSkull, "Shrival Skull");
ModLoader.addName(Murakumon1, "Murakumon");
ModLoader.addName(HeavenSpear, "Heaven Spear");
ModLoader.addName(GodBlade1, "Sword of the Late Hero (God's Blade)");
ModLoader.addName(HammerOfThor, "Thor (Mighty God Hammer)");
ModLoader.addName(GiantKnife, "The Butcher (God's Giant Knife)");
ModLoader.addName(DemonShield, "Alldemonum Shield (Dark Dragoness's Shield)");
ModLoader.addName(DragonHalbard, "Dragon Halbard (Spyro's Firey Rage)");
ModLoader.addName(CronoRiggers, "Crono Riggers (Ancient God Armor)");
ModLoader.addSmelting(WitherBow.shiftedIndex, new ItemStack(mod_Giratina.PureOrb, 3), 2.0F);
ModLoader.addSmelting(Item.swordDiamond.shiftedIndex, new ItemStack(mod_Giratina.Murakumon1, 1), 2.0F);
ModLoader.addSmelting(Murakumon1.shiftedIndex, new ItemStack(mod_Giratina.HeavenSpear, 1), 2.0F);
ModLoader.addSmelting(HeavenSpear.shiftedIndex, new ItemStack(mod_Giratina.GodBlade1, 1), 2.0F);
ModLoader.addSmelting(GodBlade1.shiftedIndex, new ItemStack(mod_Giratina.HammerOfThor, 1), 10.0F);
ModLoader.addSmelting(HammerOfThor.shiftedIndex, new ItemStack(Item.swordDiamond, 1), 10.0F);
ModLoader.addRecipe(new ItemStack(CronoRiggers,1), new Object[]{
"* *", "***", "***", Character.valueOf('*'), mod_Giratina.WitherBow});
ModLoader.addArmor("thor");
ModLoader.addAchievementDesc(Murakumon, "Murakamon", "A weapon spoken in legends, possesses ultimate power over gods and even Death, but costs the user the power to view the skys with every slash.");
ModLoader.addAchievementDesc(HeavenSpear1, "Spear from Heaven", "No one knows where it came from or who created this weapon, it is said to be what remains when Murakumon is dismantled. It is rumored to have been wielded by many gods in Heaven.");
ModLoader.addAchievementDesc(GodBlade, "Blade of God", "The ultimate sword, said to have been created by God himself. You could cut entire contries with one slash of this blade.");
ModLoader.addAchievementDesc(HammerThor, "The Gods Mighty Hammer", "This hammer, said to have been created by the son of Odin himself inflicts godly blows on undead enemies.");
WitherBow.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/griseousorb.png");
Murakumon1.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/oldironsword.png");
HeavenSpear.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/hevenspear.png");
GodBlade1.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/swordofthelatehero.png");
HammerOfThor.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/thor.png");
PureOrb.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/pureorb.png");
GiantKnife.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/giantknife.png");
ShrivalSkull.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/shrivalskull.png");
DemonShield.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/AlldemonumShield.png");
DragonHalbard.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/DragonHalbard.png");
CronoRiggers.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/CronoRiggers.png");
ModLoader.registerEntityID(EntityGiratina.class, "Giratina/Snivy", -104);
ModLoader.registerEntityID(EntityWaskomsause.class, "Waskomsause", -103);
ModLoader.registerEntityID(EntityGiratinaOrb.class, "Griseous Orb", -102);
ModLoader.registerEntityID(EntityPureOrb.class, "Pure Orb", -100);
ModLoader.registerEntityID(EntityKyurem.class, "Kyurem", -99);
ModLoader.registerEntityID(EntityShrival.class, "Shrival", -98);
ModLoader.registerEntityID(EntityShrivalThrownSkull.class, "Shrival Thrown Skull", -97);
ModLoader.registerEntityID(EntitySpyro.class, "Spyro", -96);
ModLoader.registerEntityID(EntityCynder.class, "Cynder", -95);
ModLoader.addEntityTracker(this, EntityGiratina.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntityWaskomsause.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntityGiratinaOrb.class, -115, 10, 10, true);
ModLoader.addEntityTracker(this, EntityPureOrb.class, -116, 10, 10, true);
ModLoader.addEntityTracker(this, EntityKyurem.class, -117, 10, 10, true);
ModLoader.addEntityTracker(this, EntityShrival.class, -118, 10, 10, true);
ModLoader.addEntityTracker(this, EntityShrivalThrownSkull.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntitySpyro.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntityCynder.class, -114, 10, 10, true);
ModLoader.addSpawn("Giratina", 3, 1, 10, EnumCreatureType.monster);
ModLoader.addSpawn("Waskomsause", 4, 5, 10, EnumCreatureType.creature, new BiomeGenBase[] {
BiomeGenBase.plains,
BiomeGenBase.desertHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.forestHills,
BiomeGenBase.beach,
BiomeGenBase.icePlains,
BiomeGenBase.hell,
BiomeGenBase.frozenOcean,
BiomeGenBase.desert,});
ModLoader.addSpawn("Kyurem", 1, 2, 3, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.taigaHills,
BiomeGenBase.taiga,
BiomeGenBase.icePlains,
BiomeGenBase.frozenOcean,});
ModLoader.addSpawn("Shrival", 4, 1, 3, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.beach,
BiomeGenBase.taigaHills,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.jungleHills,
BiomeGenBase.forestHills,
BiomeGenBase.hell,
BiomeGenBase.sky,
BiomeGenBase.ocean,
BiomeGenBase.frozenOcean,});
ModLoader.addSpawn("Spyro", 5, 2, 10, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.hell,});
ModLoader.addSpawn("Cynder", 5, 1, 10, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.taigaHills,
BiomeGenBase.taiga,
BiomeGenBase.swampland,
BiomeGenBase.jungle,
BiomeGenBase.forestHills,
BiomeGenBase.sky,
BiomeGenBase.frozenRiver,
BiomeGenBase.icePlains,
BiomeGenBase.iceMountains,
BiomeGenBase.forest,
BiomeGenBase.mushroomIsland,
BiomeGenBase.frozenOcean,});
ModLoader.addLocalization("entity.Giratina/Snivy.name", "Giratina/Snivy");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-104), new EntityEggInfo(-104, 894731, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Cynder.name", "Cynder");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-95), new EntityEggInfo(-95, 894732, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Shrival.name", "Shrival");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-98), new EntityEggInfo(-98, 894733, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Kyurem.name", "Kyurem");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-99), new EntityEggInfo(-99, 894734, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Spyro.name", "Spyro");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-96), new EntityEggInfo(-96, 894735, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Waskomsause.name", "Waskomsause");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-103), new EntityEggInfo(-103, 894736, (new Color(21, 15, 6)).getRGB()));//creates the spawn egg, and chnages color of egg
}
//Adds rendering and models into the game.
public void addRenderer(Map var1)
{
var1.put(EntityGiratina.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityWaskomsause.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityKyurem.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityCynder.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntitySpyro.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityShrival.class, new RenderLiving(new ModelShrival(), 0.9F));
var1.put(EntityGiratinaOrb.class, new RenderXPOrb());
}
//Awards the achievement to the player.
public void takenFromFurnace(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.Murakumon1.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(Murakumon, 1);
}
}
//Awards the achievement to the player.
public void takenFromFurnace1(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.HeavenSpear.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(HeavenSpear1, 1);
}
}
//Awards the achievement to the player.
public void takenFromFurnace2(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.GodBlade1.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(GodBlade, 1);
}
}
//Awards the achievement to the player.
public void takenFromFurnace3(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.HammerOfThor.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(HammerThor, 1);
}
}
//Adds spawning in world.
public Entity spawnEntity(int var1, World var2, double var3, double var5, double var7)
{
switch (var1)
{
case -124:
return new EntityGiratina(var2);
default:
return null;
}
}
//Same as above
public Packet23VehicleSpawn getSpawnPacket1(Entity var1, int var2)
{
if (var1 instanceof EntityGiratina)
return new Packet23VehicleSpawn();
else
return Expression;}
/* To keep biome spawning for them.
public Packet23VehicleSpawn getSpawnPacket2(Entity var1, int var2)
{
if (var1 instanceof EntityWaskomsause)
return new Packet23VehicleSpawn();
else
return Expression;}
/*
public Packet23VehicleSpawn getSpawnPacket3(Entity var1, int var2)
{
if (var1 instanceof EntityKyurem)
return new Packet23VehicleSpawn();
else
return Expression;}
/*
public Packet23VehicleSpawn getSpawnPacket4(Entity var1, int var2)
{
if (var1 instanceof EntitySpyro)
return new Packet23VehicleSpawn();
else
return Expression;}
public Packet23VehicleSpawn getSpawnPacket5(Entity var1, int var2)
{
if (var1 instanceof EntityCynder)
return new Packet23VehicleSpawn();
else
return Expression;}
*/
//Adds fuel, farly importent.
public int addFuel(int var1, int var2)
{
return 0;
}
//The version of the mod.
public String getVersion()
{
return "Restructed Project by Wielder of Freeflight";
}
}
Hey there Scmowns, I watched your video of coding the mobs, I went to add spawn eggs for each of my mobs, but when I use the egg nothing happens, the egg disappears and nothing is spawned out of it, I followed what you said about the ID of mobs, but still I got nothing, could you please help me? Heres my mod_ file code:
- Code removed for length -
Are you sure you're not in Peaceful? I was too for probably five minutes. I was so confused. Haha.
hey SCMowns i was wondering can you make a video about how to different textures for a block like a enchantment table it has different textures in the sidesof the block an top and bottom plz reply
I'm having trouble with my mod, when I generate and install it and I go and mine with my tools the block that I mine doesn't drop anything. I'm not sure whats wrong, can you take a look? If you can help me please reply, I do not know why it's not working, I think I did everything right.
Note: It worked when I tested it in the eclipse Minecraft client, but not in my actual Minecraft.
mod_MoreTools
package net.minecraft.src;
import java.util.Random;
public class mod_MoreTools extends BaseMod
{
//Register items here.
public static final Item BoneSword = new ItemSword(5000, EnumToolMaterial.BONE).setItemName("Bone Sword");
public static final Item BonePickaxe = new ItemPickaxe(5001, EnumToolMaterial.BONE).setItemName("Bone Pickaxe");
public static final Item BoneSpade = new ItemSpade(5002, EnumToolMaterial.BONE).setItemName("Bone Shovel");
public static final Item BoneAxe = new ItemAxe(5003, EnumToolMaterial.BONE).setItemName("Bone Axe");
public static final Item BoneHoe = new ItemHoe(5004, EnumToolMaterial.BONE).setItemName("Bone Hoe");
public static final Item BlazeSword = new ItemBlazeSword(5005, EnumToolMaterial.BLAZE).setItemName("Blaze Sword");
public static final Item BlazePickaxe = new ItemPickaxe(5006, EnumToolMaterial.BLAZE).setItemName("Blaze Pickaxe");
public static final Item BlazeSpade = new ItemSpade(5007, EnumToolMaterial.BLAZE).setItemName("Blaze Shovel");
public static final Item BlazeAxe = new ItemAxe(5008, EnumToolMaterial.BLAZE).setItemName("Blaze Axe");
public static final Item BlazeHoe = new ItemHoe(5009, EnumToolMaterial.BLAZE).setItemName("Blaze Hoe");
public static final Item EmeraldSword = new ItemSword(5010, EnumToolMaterial.GREEN).setItemName("Emerald Sword");
public static final Item EmeraldPickaxe = new ItemPickaxe(5011, EnumToolMaterial.GREEN).setItemName("Emerald Pickaxe");
public static final Item EmeraldSpade = new ItemSpade(5012, EnumToolMaterial.GREEN).setItemName("Emerald Shovel");
public static final Item EmeraldAxe = new ItemAxe(5013, EnumToolMaterial.GREEN).setItemName("Emerald Axe");
public static final Item EmeraldHoe = new ItemHoe(5014, EnumToolMaterial.GREEN).setItemName("Emerald Hoe");
public static final Item NetherrackSword = new ItemNetherrackSword(5015, EnumToolMaterial.RACK).setItemName("Netherrack Sword");
public static final Item NetherrackPickaxe = new ItemPickaxe(5016, EnumToolMaterial.RACK).setItemName("Netherrack Pickaxe");
public static final Item NetherrackSpade = new ItemSpade(5017, EnumToolMaterial.RACK).setItemName("Netherrack Shovel");
public static final Item NetherrackAxe = new ItemAxe(5018, EnumToolMaterial.RACK).setItemName("Netherrack Axe");
public static final Item NetherrackHoe = new ItemHoe(5019, EnumToolMaterial.RACK).setItemName("Netherrack Hoe");
public void load()
{
//Register items into mod loader here.
BoneSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneSword.png");
ModLoader.addName(BoneSword, "Bone Sword");
ModLoader.addRecipe(new ItemStack(BoneSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Item.bone
});
BonePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBonePickaxe.png");
ModLoader.addName(BonePickaxe, "Bone Pickaxe");
ModLoader.addRecipe(new ItemStack(BonePickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Item.bone
});
BoneSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneShovel.png");
ModLoader.addName(BoneSpade, "Bone Shovel");
ModLoader.addRecipe(new ItemStack(BoneSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Item.bone
});
BoneAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneAxe.png");
ModLoader.addName(BoneAxe, "Bone Axe");
ModLoader.addRecipe(new ItemStack(BoneAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Item.bone
});
BoneHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneHoe.png");
ModLoader.addName(BoneHoe, "Bone Hoe");
ModLoader.addRecipe(new ItemStack(BoneHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Item.bone
});
BlazeSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeSword.png");
ModLoader.addName(BlazeSword, "Blaze Sword");
ModLoader.addRecipe(new ItemStack(BlazeSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazePickaxe.png");
ModLoader.addName(BlazePickaxe, "Blaze Pickaxe");
ModLoader.addRecipe(new ItemStack(BlazePickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazeSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeShovel.png");
ModLoader.addName(BlazeSpade, "Blaze Shovel");
ModLoader.addRecipe(new ItemStack(BlazeSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazeAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeAxe.png");
ModLoader.addName(BlazeAxe, "Blaze Axe");
ModLoader.addRecipe(new ItemStack(BlazeAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazeHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeHoe.png");
ModLoader.addName(BlazeHoe, "Blaze Hoe");
ModLoader.addRecipe(new ItemStack(BlazeHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
EmeraldSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldSword.png");
ModLoader.addName(EmeraldSword, "Emerald Sword");
ModLoader.addRecipe(new ItemStack(EmeraldSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldPickaxe.png");
ModLoader.addName(EmeraldPickaxe, "Emerald Pickaxe");
ModLoader.addRecipe(new ItemStack(EmeraldPickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldShovel.png");
ModLoader.addName(EmeraldSpade, "Emerald Shovel");
ModLoader.addRecipe(new ItemStack(EmeraldSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldAxe.png");
ModLoader.addName(EmeraldAxe, "Emerald Axe");
ModLoader.addRecipe(new ItemStack(EmeraldAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldHoe.png");
ModLoader.addName(EmeraldHoe, "Emerald Hoe");
ModLoader.addRecipe(new ItemStack(EmeraldHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Item.emerald
});
NetherrackSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackSword.png");
ModLoader.addName(NetherrackSword, "Netherrack Sword");
ModLoader.addRecipe(new ItemStack(NetherrackSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackPickaxe.png");
ModLoader.addName(NetherrackPickaxe, "Netherrack Pickaxe");
ModLoader.addRecipe(new ItemStack(NetherrackPickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackShovel.png");
ModLoader.addName(NetherrackSpade, "Netherrack Shovel");
ModLoader.addRecipe(new ItemStack(NetherrackSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackAxe.png");
ModLoader.addName(NetherrackAxe, "Netherrack Axe");
ModLoader.addRecipe(new ItemStack(NetherrackAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackHoe.png");
ModLoader.addName(NetherrackHoe, "Netherrack Hoe");
ModLoader.addRecipe(new ItemStack(NetherrackHoe), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
//Add items to inventory here.
BoneSword.setCreativeTab(CreativeTabs.tabCombat);
BonePickaxe.setCreativeTab(CreativeTabs.tabTools);
BoneSpade.setCreativeTab(CreativeTabs.tabTools);
BoneAxe.setCreativeTab(CreativeTabs.tabTools);
BoneHoe.setCreativeTab(CreativeTabs.tabTools);
BlazeSword.setCreativeTab(CreativeTabs.tabCombat);
BlazePickaxe.setCreativeTab(CreativeTabs.tabTools);
BlazeSpade.setCreativeTab(CreativeTabs.tabTools);
BlazeAxe.setCreativeTab(CreativeTabs.tabTools);
BlazeHoe.setCreativeTab(CreativeTabs.tabTools);
EmeraldSword.setCreativeTab(CreativeTabs.tabCombat);
EmeraldPickaxe.setCreativeTab(CreativeTabs.tabTools);
EmeraldSpade.setCreativeTab(CreativeTabs.tabTools);
EmeraldAxe.setCreativeTab(CreativeTabs.tabTools);
EmeraldHoe.setCreativeTab(CreativeTabs.tabTools);
NetherrackSword.setCreativeTab(CreativeTabs.tabCombat);
NetherrackPickaxe.setCreativeTab(CreativeTabs.tabTools);
NetherrackSpade.setCreativeTab(CreativeTabs.tabTools);
NetherrackAxe.setCreativeTab(CreativeTabs.tabTools);
NetherrackHoe.setCreativeTab(CreativeTabs.tabTools);
}
public String getVersion()
{
//Make sure to return the correct version.
return "MoreTools v.0.01";
}
}
//A Blokster Studios Creation. Do not steal!
ItemBlazeSword
package net.minecraft.src;
public class ItemBlazeSword extends ItemSword {
public ItemBlazeSword(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
}
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{
entityliving.setFire(20);
return true;
}
public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
public String getItemDisplayName(ItemStack par1ItemStack){
String var2 = ("\u00a74" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim();
return var2;
}
}
ItemNetherrackSword
package net.minecraft.src;
public class ItemNetherrackSword extends ItemSword {
public ItemNetherrackSword(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
}
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{
entityliving.setFire(10);
return true;
}
public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
public String getItemDisplayName(ItemStack par1ItemStack){
String var2 = ("\u00a74" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim();
return var2;
}
}
EnumToolMaterial
package net.minecraft.src;
public enum EnumToolMaterial
{
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),
BONE(1, 85, 3.0F, 1, 15),
BLAZE(2, 450, 5.0F, 2, 5),
GREEN(3, 2561, 8.0F, 3, 22),
RACK(1, 100, 6.0F, 1, 5);
/**
* 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 EnumToolMaterial(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))));
}
}
Just a quick question but with your tutorial on making a new custom mob... say i wanted to add two to the game instead of just one... what would i have to change/add to the code to make that happen? .-.
Make a new mod_MOB and copy the code, but make a new ID, Texture, ModelMOB, etc.
Hey there Scmowns, I watched your video of coding the mobs, I went to add spawn eggs for each of my mobs, but when I use the egg nothing happens, the egg disappears and nothing is spawned out of it, I followed what you said about the ID of mobs, but still I got nothing, could you please help me? Heres my mod_ file code:
package net.minecraft.src;
//Forum page can be found here. http://www.minecraftforum.net/topic/1598838-145-cybers-restructed-project-remastered-giratina-and-redux-swords/
//Pictures seen in the forum thread are of this project not made by me, make sure you download it: http://www.minecraftforum.net/topic/1532871-minecraft-cynder-and-spyro/
import java.util.Map;
import java.awt.Color;
import java.io.File;
import java.util.Random;
import net.minecraft.client.Minecraft;
//Mod created by CyberstormFromLU. http://www.minecraftforum.net/user/1206795-cyberfromlu/
//DISCLAIMER: This mod is totally random, things within this mod are all from insperation, nothing else.
public class mod_Giratina extends BaseMod
{ //Backbone of the mod file.
public static final Item WitherBow = (new ItemGiratinaOrb(1336)).setItemName("GriseousOrb");
public static final Item PureOrb = (new ItemPureOrb(1341)).setItemName("Pure Orb");
public static final Item Murakumon1 = (new ItemMurakumon(1337)).setItemName("Murakumon");
public static final Item HeavenSpear = (new ItemHeavenSpear(1338)).setItemName("Heaven Spear");
public static final Item GodBlade1 = (new ItemGodBlade(1339)).setItemName("Sword of the Late Hero (God's Blade)");
public static final Item HammerOfThor = (new ItemHammerOfGod(1340)).setItemName("Thor (Mighty God Hammer)");
public static final Item GiantKnife = (new ItemGiantKnife(1342)).setItemName("The Butcher (God's Giant Knife)");
public static final Item ShrivalSkull = (new ItemShrivalSkull(1343)).setItemName("Shrival Skull");
public static final Item DemonShield = (new ItemDemonShield(1344)).setItemName("Alldemonum Shield");
public static final Item DragonHalbard = (new ItemDragonHalbard(1345)).setItemName("Dragon Halbard (Spyro's Firey Rage)");
public static final Item CronoRiggers = (new ItemArmor(1346, EnumArmorMaterial.DIAMOND ,5,1 ).setItemName("Crono Riggers"));
static Achievement openInventory = AchievementList.openInventory;
public static final Enchantment spiralEnchantment = new meteroArrowEnchantment(36, 10, EnumEnchantmentType.weapon).setName("Metro Arrow");
public static final Achievement Murakumon = new Achievement(5000, "Murakumon", 4, 9, mod_Giratina.Murakumon1, openInventory).registerAchievement();
public static final Achievement HeavenSpear1 = new Achievement(5001, "Spear from Heaven", 4, 15, mod_Giratina.HeavenSpear, Murakumon).registerAchievement();
public static final Achievement GodBlade = new Achievement(5002, "Blade of God", 4, 18, mod_Giratina.GodBlade1, HeavenSpear1).registerAchievement();
public static final Achievement HammerThor = new Achievement(5003, "God's Final Weapon", 4, 20, mod_Giratina.HammerOfThor, GodBlade).registerAchievement();
public static DamageSource DeathDamage = (new DamageSource("Decapatate")).setMagicDamage().setFireDamage();
public static final Potion Death = (new Potion(21, true, 9000001)).setPotionName("Mark of Death").setEffectiveness(0.45D);
private static final Packet23VehicleSpawn Expression = null;
//Heres the config file, contains mob and item ids and achievement ids so you may change them to avoid conflict with other mods that use the same ids.
@MLProp(name = "GrisesousOrbID", info = "Default ID of the Griseous Orb")
public static int WitherBowID = 1336;
@MLProp(name = "MurakumonID", info = "Default ID of Murakumon")
public static int MurakumonID = 1337;
@MLProp(name = "HeavenSpearID", info = "Default ID of Heaven Spear")
public static int HeavenSpearID = 1338;
@MLProp(name = "GodBladeID", info = "Default ID of God Blade (Sword of the late Hero)")
public static int GodBladeID = 1339;
@MLProp(name = "GiratinaSnivyID", info = "ID used for Giratina/Snivy.")
public static int GiratinaSnivyID = -104;
@MLProp(name = "GiratinaOrbID", info = "ID used for EntityThrownGiratinaOrb.")
public static int GiratinaOrbID = -102;
@MLProp(name = "MurakumonAchievement", info = "ID used for Murakumon achievement")
public static int MurakumonAchievement = 5000;
@MLProp(name = "SpearFromHeaven", info = "ID used for Spear From Heaven achievement")
public static int SpearFromHeaven = 5001;
@MLProp(name = "BladeOfGodAchievement", info = "ID used for Blade of God achievement")
public static int BladeOfGodAchievement = 5002;
@MLProp(name = "DeathPotionEffect", info = "ID used for WIP Death potion effect.")
public static int DeathPotionEffect = 21;
@MLProp(name = "MetroArrowEnchantment", info = "ID used for Metro Arrow Enchantment.")
public static int MetroArrowEnchantment = 36;
@MLProp(name = "HammerOfThorID", info = "ID used for Thor Hammer")
public static int HammerOfThorID = 1340;
@MLProp(name = "MightyGodHammerAchievement", info = "ID used for Mighty God Hammer achievement")
public static int MightyGodHammerAchievement = 5003;
@MLProp(name = "WaskomsauseID", info = "ID used for Waskomsause.")
public static int WaskomsauseID = -103;
@MLProp(name = "ThrownPureOrbID", info = "ID used for EntityPureOrb.")
public static int ThrownPureOrbID = -100;
@MLProp(name = "PureOrbID", info = "Default ID of the Pure Orb")
public static int PureOrbID = 1341;
@MLProp(name = "KyuremID", info = "Default ID of Kyurem")
public static int KyuremID = -99;
@MLProp(name = "GiantKnifeID", info = "Default ID of The Butcher.")
public static int GiantKnifeID = 1342;
@MLProp(name = "ShrivalSkullID", info = "Default ID of Shrival Skull.")
public static int ShrivalSkullID = 1343;
@MLProp(name = "DemonShieldID", info = "Default ID of Demon Shield.")
public static int DemonShieldID = 1344;
@MLProp(name = "DragonHalbardID", info = "Default ID of the Dragon Halbard.")
public static int DragonHalbardID = 1345;
@MLProp(name = "ShrivalID", info = "Default ID of the Shrival.")
public static int ShrivalID = -98;
@MLProp(name = "ThrownSkullID", info = "Default ID of Thrown Skull Entitys.")
public static int ThrownSkullID = -97;
@MLProp(name = "SpyroID", info = "Default ID of Spyro.")
public static int SpyroID = -96;
@MLProp(name = "CynderID", info = "Default ID of Cynder.")
public static int CynderID = -95;
@MLProp(name = "CronoRiggersID", info = "Default ID of CronoRiggers.")
public static int CronoRiggersID = -95;
//Adds all mobs, items and achievements into the game.
public void load()
{
ModLoader.addName(WitherBow, "Griseous Orb");
ModLoader.addName(PureOrb, "Pure Orb");
ModLoader.addName(ShrivalSkull, "Shrival Skull");
ModLoader.addName(Murakumon1, "Murakumon");
ModLoader.addName(HeavenSpear, "Heaven Spear");
ModLoader.addName(GodBlade1, "Sword of the Late Hero (God's Blade)");
ModLoader.addName(HammerOfThor, "Thor (Mighty God Hammer)");
ModLoader.addName(GiantKnife, "The Butcher (God's Giant Knife)");
ModLoader.addName(DemonShield, "Alldemonum Shield (Dark Dragoness's Shield)");
ModLoader.addName(DragonHalbard, "Dragon Halbard (Spyro's Firey Rage)");
ModLoader.addName(CronoRiggers, "Crono Riggers (Ancient God Armor)");
ModLoader.addSmelting(WitherBow.shiftedIndex, new ItemStack(mod_Giratina.PureOrb, 3), 2.0F);
ModLoader.addSmelting(Item.swordDiamond.shiftedIndex, new ItemStack(mod_Giratina.Murakumon1, 1), 2.0F);
ModLoader.addSmelting(Murakumon1.shiftedIndex, new ItemStack(mod_Giratina.HeavenSpear, 1), 2.0F);
ModLoader.addSmelting(HeavenSpear.shiftedIndex, new ItemStack(mod_Giratina.GodBlade1, 1), 2.0F);
ModLoader.addSmelting(GodBlade1.shiftedIndex, new ItemStack(mod_Giratina.HammerOfThor, 1), 10.0F);
ModLoader.addSmelting(HammerOfThor.shiftedIndex, new ItemStack(Item.swordDiamond, 1), 10.0F);
ModLoader.addRecipe(new ItemStack(CronoRiggers,1), new Object[]{
"* *", "***", "***", Character.valueOf('*'), mod_Giratina.WitherBow});
ModLoader.addArmor("thor");
ModLoader.addAchievementDesc(Murakumon, "Murakamon", "A weapon spoken in legends, possesses ultimate power over gods and even Death, but costs the user the power to view the skys with every slash.");
ModLoader.addAchievementDesc(HeavenSpear1, "Spear from Heaven", "No one knows where it came from or who created this weapon, it is said to be what remains when Murakumon is dismantled. It is rumored to have been wielded by many gods in Heaven.");
ModLoader.addAchievementDesc(GodBlade, "Blade of God", "The ultimate sword, said to have been created by God himself. You could cut entire contries with one slash of this blade.");
ModLoader.addAchievementDesc(HammerThor, "The Gods Mighty Hammer", "This hammer, said to have been created by the son of Odin himself inflicts godly blows on undead enemies.");
WitherBow.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/griseousorb.png");
Murakumon1.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/oldironsword.png");
HeavenSpear.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/hevenspear.png");
GodBlade1.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/swordofthelatehero.png");
HammerOfThor.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/thor.png");
PureOrb.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/pureorb.png");
GiantKnife.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/giantknife.png");
ShrivalSkull.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/shrivalskull.png");
DemonShield.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/AlldemonumShield.png");
DragonHalbard.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/DragonHalbard.png");
CronoRiggers.iconIndex = ModLoader.addOverride("/gui/items.png", "/cybergiratina/CronoRiggers.png");
ModLoader.registerEntityID(EntityGiratina.class, "Giratina/Snivy", -104);
ModLoader.registerEntityID(EntityWaskomsause.class, "Waskomsause", -103);
ModLoader.registerEntityID(EntityGiratinaOrb.class, "Griseous Orb", -102);
ModLoader.registerEntityID(EntityPureOrb.class, "Pure Orb", -100);
ModLoader.registerEntityID(EntityKyurem.class, "Kyurem", -99);
ModLoader.registerEntityID(EntityShrival.class, "Shrival", -98);
ModLoader.registerEntityID(EntityShrivalThrownSkull.class, "Shrival Thrown Skull", -97);
ModLoader.registerEntityID(EntitySpyro.class, "Spyro", -96);
ModLoader.registerEntityID(EntityCynder.class, "Cynder", -95);
ModLoader.addEntityTracker(this, EntityGiratina.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntityWaskomsause.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntityGiratinaOrb.class, -115, 10, 10, true);
ModLoader.addEntityTracker(this, EntityPureOrb.class, -116, 10, 10, true);
ModLoader.addEntityTracker(this, EntityKyurem.class, -117, 10, 10, true);
ModLoader.addEntityTracker(this, EntityShrival.class, -118, 10, 10, true);
ModLoader.addEntityTracker(this, EntityShrivalThrownSkull.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntitySpyro.class, -114, 10, 10, true);
ModLoader.addEntityTracker(this, EntityCynder.class, -114, 10, 10, true);
ModLoader.addSpawn("Giratina", 3, 1, 10, EnumCreatureType.monster);
ModLoader.addSpawn("Waskomsause", 4, 5, 10, EnumCreatureType.creature, new BiomeGenBase[] {
BiomeGenBase.plains,
BiomeGenBase.desertHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.forestHills,
BiomeGenBase.beach,
BiomeGenBase.icePlains,
BiomeGenBase.hell,
BiomeGenBase.frozenOcean,
BiomeGenBase.desert,});
ModLoader.addSpawn("Kyurem", 1, 2, 3, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.taigaHills,
BiomeGenBase.taiga,
BiomeGenBase.icePlains,
BiomeGenBase.frozenOcean,});
ModLoader.addSpawn("Shrival", 4, 1, 3, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.beach,
BiomeGenBase.taigaHills,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.jungleHills,
BiomeGenBase.forestHills,
BiomeGenBase.hell,
BiomeGenBase.sky,
BiomeGenBase.ocean,
BiomeGenBase.frozenOcean,});
ModLoader.addSpawn("Spyro", 5, 2, 10, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.hell,});
ModLoader.addSpawn("Cynder", 5, 1, 10, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.taigaHills,
BiomeGenBase.taiga,
BiomeGenBase.swampland,
BiomeGenBase.jungle,
BiomeGenBase.forestHills,
BiomeGenBase.sky,
BiomeGenBase.frozenRiver,
BiomeGenBase.icePlains,
BiomeGenBase.iceMountains,
BiomeGenBase.forest,
BiomeGenBase.mushroomIsland,
BiomeGenBase.frozenOcean,});
ModLoader.addLocalization("entity.Giratina/Snivy.name", "Giratina/Snivy");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-104), new EntityEggInfo(-104, 894731, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Cynder.name", "Cynder");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-95), new EntityEggInfo(-95, 894732, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Shrival.name", "Shrival");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-98), new EntityEggInfo(-98, 894733, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Kyurem.name", "Kyurem");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-99), new EntityEggInfo(-99, 894734, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Spyro.name", "Spyro");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-96), new EntityEggInfo(-96, 894735, (new Color(21, 15, 6)).getRGB()));
ModLoader.addLocalization("entity.Waskomsause.name", "Waskomsause");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(-103), new EntityEggInfo(-103, 894736, (new Color(21, 15, 6)).getRGB()));//creates the spawn egg, and chnages color of egg
}
//Adds rendering and models into the game.
public void addRenderer(Map var1)
{
var1.put(EntityGiratina.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityWaskomsause.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityKyurem.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityCynder.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntitySpyro.class, new RenderBiped(new ModelBiped(), 0.9F));
var1.put(EntityShrival.class, new RenderLiving(new ModelShrival(), 0.9F));
var1.put(EntityGiratinaOrb.class, new RenderXPOrb());
}
//Awards the achievement to the player.
public void takenFromFurnace(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.Murakumon1.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(Murakumon, 1);
}
}
//Awards the achievement to the player.
public void takenFromFurnace1(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.HeavenSpear.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(HeavenSpear1, 1);
}
}
//Awards the achievement to the player.
public void takenFromFurnace2(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.GodBlade1.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(GodBlade, 1);
}
}
//Awards the achievement to the player.
public void takenFromFurnace3(EntityPlayer entityplayer, ItemStack itemstack)
{
if (itemstack.itemID == mod_Giratina.HammerOfThor.shiftedIndex)
{
ModLoader.getMinecraftInstance().thePlayer.addStat(HammerThor, 1);
}
}
//Adds spawning in world.
public Entity spawnEntity(int var1, World var2, double var3, double var5, double var7)
{
switch (var1)
{
case -124:
return new EntityGiratina(var2);
default:
return null;
}
}
//Same as above
public Packet23VehicleSpawn getSpawnPacket1(Entity var1, int var2)
{
if (var1 instanceof EntityGiratina)
return new Packet23VehicleSpawn();
else
return Expression;}
/* To keep biome spawning for them.
public Packet23VehicleSpawn getSpawnPacket2(Entity var1, int var2)
{
if (var1 instanceof EntityWaskomsause)
return new Packet23VehicleSpawn();
else
return Expression;}
/*
public Packet23VehicleSpawn getSpawnPacket3(Entity var1, int var2)
{
if (var1 instanceof EntityKyurem)
return new Packet23VehicleSpawn();
else
return Expression;}
/*
public Packet23VehicleSpawn getSpawnPacket4(Entity var1, int var2)
{
if (var1 instanceof EntitySpyro)
return new Packet23VehicleSpawn();
else
return Expression;}
public Packet23VehicleSpawn getSpawnPacket5(Entity var1, int var2)
{
if (var1 instanceof EntityCynder)
return new Packet23VehicleSpawn();
else
return Expression;}
*/
//Adds fuel, farly importent.
public int addFuel(int var1, int var2)
{
return 0;
}
//The version of the mod.
public String getVersion()
{
return "Restructed Project by Wielder of Freeflight";
}
}
You don't get any error correct? You didn't make a new class for your mob like how we did in our tutorial?
Hey SCMowns, I keep getting this error when my custom structure generates:
http://java.lang.NullPointerException at net.minecraft.src.TileEntity.func_85027_a(TileEntity.java:245) at net.minecraft.src.World.updateEntities(World.java:2021) at net.minecraft.src.WorldServer.updateEntities(WorldServer.java:444) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:667) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:590) at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:124) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:500) at net.minecraft.src.ThreadMinecraftServer.run(ThreadMinecraftServer.java:18) --- END ERROR REPORT fbd596e0 ----------
My generate code located within my mod_ file:
//This generates Restructed pillers, these contain useful items and materials.
public void generateSurface(World world, Random random, int i, int j)
{
if (random.nextInt(200) == 0)
{
int k = 0;
for (int l = 86; l > 1; l--)
{
if (world.getBlockId(i, l, j) == 0 && world.getBlockId(i, l - 1, j) != 0)
{
k = l;
}
}
for (int i1 = k; i1 < k + 40; i1++)
{
for (int l1 = 0; l1 < 10; l1++)
{
for (int k2 = 0; k2 < 10; k2++)
{
int j3 = Block.waterMoving.blockID;
if (random.nextInt(4) == 0)
{
j3 = Block.oreRedstone.blockID;
}
world.setBlock(i + l1, i1, j + k2, j3);
}
}
}
for (int j1 = k + 1; j1 < k + 39; j1++)
{
for (int i2 = 1; i2 < 9; i2++)
{
for (int l2 = 1; l2 < 9; l2++)
{
world.setBlock(i + i2, j1, j + l2, 0);
}
}
}
for (int k1 = 0; k1 < 7; k1++)
{
world.setBlock(i + 1, k + 38, j + 1, Block.torchWood.blockID);
world.setBlock(i + 8, k + 38, j + 8, Block.torchWood.blockID);
world.setBlock(i + 8, k + 38, j + 1, Block.torchWood.blockID);
world.setBlock(i + 1, k + 38, j + 8, Block.torchWood.blockID);
}
world.setBlock(i + 5, k + 1, j + 5, Block.chest.blockID);
world.setBlock(i + 5, k + 2, j + 5, Block.mobSpawner.blockID);
TileEntityChest tileentitychest = new TileEntityChest();
world.setBlockTileEntity(i + 5, k + 1, j + 5, tileentitychest);
tileentitychest.setInventorySlotContents(1, new ItemStack(CronoRiggers.shiftedIndex, 1, 0));
tileentitychest.setInventorySlotContents(2, new ItemStack(Item.diamond.shiftedIndex, 8, 0));
tileentitychest.setInventorySlotContents(3, new ItemStack(Item.porkCooked.shiftedIndex, 30, 0));
tileentitychest.setInventorySlotContents(4, new ItemStack(Block.planks.blockID, 30, 0));
TileEntityMobSpawner tileentitymobspawner = new TileEntityMobSpawner();
world.setBlockTileEntity(i + 5, k + 8, j + 5, tileentitymobspawner);
tileentitymobspawner.setMobID(pickMobSpawner(random));}
}
private String pickMobSpawner(Random random)
{
int i = random.nextInt(4);
if (i == 0)
{
return "Kyurem";
}
if (i == 1)
{
return "Shrival";
}
if (i == 2)
{
return "Zombie";
}
if (i == 3)
{
return "Skeleton";
}
else
{
return "";
}
Do you know of anything how to fix this? I can get the chest to work but not the spawner, if I change it comes up as a pig spawner, is there anyway to make it just one type of spawner without crashing or becoming a pig spawner? or is this just unfix-able?
Hey SCMowns, I keep getting this error when my custom structure generates:
http://java.lang.NullPointerException at net.minecraft.src.TileEntity.func_85027_a(TileEntity.java:245) at net.minecraft.src.World.updateEntities(World.java:2021) at net.minecraft.src.WorldServer.updateEntities(WorldServer.java:444) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:667) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:590) at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:124) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:500) at net.minecraft.src.ThreadMinecraftServer.run(ThreadMinecraftServer.java:18) --- END ERROR REPORT fbd596e0 ----------
My generate code located within my mod_ file:
//This generates Restructed pillers, these contain useful items and materials.
public void generateSurface(World world, Random random, int i, int j)
{
if (random.nextInt(200) == 0)
{
int k = 0;
for (int l = 86; l > 1; l--)
{
if (world.getBlockId(i, l, j) == 0 && world.getBlockId(i, l - 1, j) != 0)
{
k = l;
}
}
for (int i1 = k; i1 < k + 40; i1++)
{
for (int l1 = 0; l1 < 10; l1++)
{
for (int k2 = 0; k2 < 10; k2++)
{
int j3 = Block.waterMoving.blockID;
if (random.nextInt(4) == 0)
{
j3 = Block.oreRedstone.blockID;
}
world.setBlock(i + l1, i1, j + k2, j3);
}
}
}
for (int j1 = k + 1; j1 < k + 39; j1++)
{
for (int i2 = 1; i2 < 9; i2++)
{
for (int l2 = 1; l2 < 9; l2++)
{
world.setBlock(i + i2, j1, j + l2, 0);
}
}
}
for (int k1 = 0; k1 < 7; k1++)
{
world.setBlock(i + 1, k + 38, j + 1, Block.torchWood.blockID);
world.setBlock(i + 8, k + 38, j + 8, Block.torchWood.blockID);
world.setBlock(i + 8, k + 38, j + 1, Block.torchWood.blockID);
world.setBlock(i + 1, k + 38, j + 8, Block.torchWood.blockID);
}
world.setBlock(i + 5, k + 1, j + 5, Block.chest.blockID);
world.setBlock(i + 5, k + 2, j + 5, Block.mobSpawner.blockID);
TileEntityChest tileentitychest = new TileEntityChest();
world.setBlockTileEntity(i + 5, k + 1, j + 5, tileentitychest);
tileentitychest.setInventorySlotContents(1, new ItemStack(CronoRiggers.shiftedIndex, 1, 0));
tileentitychest.setInventorySlotContents(2, new ItemStack(Item.diamond.shiftedIndex, 8, 0));
tileentitychest.setInventorySlotContents(3, new ItemStack(Item.porkCooked.shiftedIndex, 30, 0));
tileentitychest.setInventorySlotContents(4, new ItemStack(Block.planks.blockID, 30, 0));
TileEntityMobSpawner tileentitymobspawner = new TileEntityMobSpawner();
world.setBlockTileEntity(i + 5, k + 8, j + 5, tileentitymobspawner);
tileentitymobspawner.setMobID(pickMobSpawner(random));}
}
private String pickMobSpawner(Random random)
{
int i = random.nextInt(4);
if (i == 0)
{
return "Kyurem";
}
if (i == 1)
{
return "Shrival";
}
if (i == 2)
{
return "Zombie";
}
if (i == 3)
{
return "Skeleton";
}
else
{
return "";
}
Do you know of anything how to fix this? I can get the chest to work but not the spawner, if I change it comes up as a pig spawner, is there anyway to make it just one type of spawner without crashing or becoming a pig spawner? or is this just unfix-able?
One problem with your code is that a mob id an int, not a String.
Rollback Post to RevisionRollBack
GENERATION 98: The first time you see this, copy it into your signature on any forum and subtract 1 from the generation. Social experiment.
Actually, he means dimensions.
Are you sure you're not in Peaceful? I was too for probably five minutes. I was so confused. Haha.
Note: It worked when I tested it in the eclipse Minecraft client, but not in my actual Minecraft.
mod_MoreTools
package net.minecraft.src; import java.util.Random; public class mod_MoreTools extends BaseMod { //Register items here. public static final Item BoneSword = new ItemSword(5000, EnumToolMaterial.BONE).setItemName("Bone Sword"); public static final Item BonePickaxe = new ItemPickaxe(5001, EnumToolMaterial.BONE).setItemName("Bone Pickaxe"); public static final Item BoneSpade = new ItemSpade(5002, EnumToolMaterial.BONE).setItemName("Bone Shovel"); public static final Item BoneAxe = new ItemAxe(5003, EnumToolMaterial.BONE).setItemName("Bone Axe"); public static final Item BoneHoe = new ItemHoe(5004, EnumToolMaterial.BONE).setItemName("Bone Hoe"); public static final Item BlazeSword = new ItemBlazeSword(5005, EnumToolMaterial.BLAZE).setItemName("Blaze Sword"); public static final Item BlazePickaxe = new ItemPickaxe(5006, EnumToolMaterial.BLAZE).setItemName("Blaze Pickaxe"); public static final Item BlazeSpade = new ItemSpade(5007, EnumToolMaterial.BLAZE).setItemName("Blaze Shovel"); public static final Item BlazeAxe = new ItemAxe(5008, EnumToolMaterial.BLAZE).setItemName("Blaze Axe"); public static final Item BlazeHoe = new ItemHoe(5009, EnumToolMaterial.BLAZE).setItemName("Blaze Hoe"); public static final Item EmeraldSword = new ItemSword(5010, EnumToolMaterial.GREEN).setItemName("Emerald Sword"); public static final Item EmeraldPickaxe = new ItemPickaxe(5011, EnumToolMaterial.GREEN).setItemName("Emerald Pickaxe"); public static final Item EmeraldSpade = new ItemSpade(5012, EnumToolMaterial.GREEN).setItemName("Emerald Shovel"); public static final Item EmeraldAxe = new ItemAxe(5013, EnumToolMaterial.GREEN).setItemName("Emerald Axe"); public static final Item EmeraldHoe = new ItemHoe(5014, EnumToolMaterial.GREEN).setItemName("Emerald Hoe"); public static final Item NetherrackSword = new ItemNetherrackSword(5015, EnumToolMaterial.RACK).setItemName("Netherrack Sword"); public static final Item NetherrackPickaxe = new ItemPickaxe(5016, EnumToolMaterial.RACK).setItemName("Netherrack Pickaxe"); public static final Item NetherrackSpade = new ItemSpade(5017, EnumToolMaterial.RACK).setItemName("Netherrack Shovel"); public static final Item NetherrackAxe = new ItemAxe(5018, EnumToolMaterial.RACK).setItemName("Netherrack Axe"); public static final Item NetherrackHoe = new ItemHoe(5019, EnumToolMaterial.RACK).setItemName("Netherrack Hoe"); public void load() { //Register items into mod loader here. BoneSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneSword.png"); ModLoader.addName(BoneSword, "Bone Sword"); ModLoader.addRecipe(new ItemStack(BoneSword, 1), new Object[] { " * ", " * ", " X ", 'X', Item.stick, '*', Item.bone }); BonePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBonePickaxe.png"); ModLoader.addName(BonePickaxe, "Bone Pickaxe"); ModLoader.addRecipe(new ItemStack(BonePickaxe, 1), new Object[] { "***", " X ", " X ", 'X', Item.stick, '*', Item.bone }); BoneSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneShovel.png"); ModLoader.addName(BoneSpade, "Bone Shovel"); ModLoader.addRecipe(new ItemStack(BoneSpade, 1), new Object[] { " * ", " X ", " X ", 'X', Item.stick, '*', Item.bone }); BoneAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneAxe.png"); ModLoader.addName(BoneAxe, "Bone Axe"); ModLoader.addRecipe(new ItemStack(BoneAxe, 1), new Object[] { "** ", "*X ", " X ", 'X', Item.stick, '*', Item.bone }); BoneHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneHoe.png"); ModLoader.addName(BoneHoe, "Bone Hoe"); ModLoader.addRecipe(new ItemStack(BoneHoe, 1), new Object[] { "** ", " X ", " X ", 'X', Item.stick, '*', Item.bone }); BlazeSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeSword.png"); ModLoader.addName(BlazeSword, "Blaze Sword"); ModLoader.addRecipe(new ItemStack(BlazeSword, 1), new Object[] { " * ", " * ", " X ", 'X', Item.stick, '*', Item.blazeRod }); BlazePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazePickaxe.png"); ModLoader.addName(BlazePickaxe, "Blaze Pickaxe"); ModLoader.addRecipe(new ItemStack(BlazePickaxe, 1), new Object[] { "***", " X ", " X ", 'X', Item.stick, '*', Item.blazeRod }); BlazeSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeShovel.png"); ModLoader.addName(BlazeSpade, "Blaze Shovel"); ModLoader.addRecipe(new ItemStack(BlazeSpade, 1), new Object[] { " * ", " X ", " X ", 'X', Item.stick, '*', Item.blazeRod }); BlazeAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeAxe.png"); ModLoader.addName(BlazeAxe, "Blaze Axe"); ModLoader.addRecipe(new ItemStack(BlazeAxe, 1), new Object[] { "** ", "*X ", " X ", 'X', Item.stick, '*', Item.blazeRod }); BlazeHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeHoe.png"); ModLoader.addName(BlazeHoe, "Blaze Hoe"); ModLoader.addRecipe(new ItemStack(BlazeHoe, 1), new Object[] { "** ", " X ", " X ", 'X', Item.stick, '*', Item.blazeRod }); EmeraldSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldSword.png"); ModLoader.addName(EmeraldSword, "Emerald Sword"); ModLoader.addRecipe(new ItemStack(EmeraldSword, 1), new Object[] { " * ", " * ", " X ", 'X', Item.stick, '*', Item.emerald }); EmeraldPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldPickaxe.png"); ModLoader.addName(EmeraldPickaxe, "Emerald Pickaxe"); ModLoader.addRecipe(new ItemStack(EmeraldPickaxe, 1), new Object[] { "***", " X ", " X ", 'X', Item.stick, '*', Item.emerald }); EmeraldSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldShovel.png"); ModLoader.addName(EmeraldSpade, "Emerald Shovel"); ModLoader.addRecipe(new ItemStack(EmeraldSpade, 1), new Object[] { " * ", " X ", " X ", 'X', Item.stick, '*', Item.emerald }); EmeraldAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldAxe.png"); ModLoader.addName(EmeraldAxe, "Emerald Axe"); ModLoader.addRecipe(new ItemStack(EmeraldAxe, 1), new Object[] { "** ", "*X ", " X ", 'X', Item.stick, '*', Item.emerald }); EmeraldHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldHoe.png"); ModLoader.addName(EmeraldHoe, "Emerald Hoe"); ModLoader.addRecipe(new ItemStack(EmeraldHoe, 1), new Object[] { "** ", " X ", " X ", 'X', Item.stick, '*', Item.emerald }); NetherrackSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackSword.png"); ModLoader.addName(NetherrackSword, "Netherrack Sword"); ModLoader.addRecipe(new ItemStack(NetherrackSword, 1), new Object[] { " * ", " * ", " X ", 'X', Item.stick, '*', Block.netherrack }); NetherrackPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackPickaxe.png"); ModLoader.addName(NetherrackPickaxe, "Netherrack Pickaxe"); ModLoader.addRecipe(new ItemStack(NetherrackPickaxe, 1), new Object[] { "***", " X ", " X ", 'X', Item.stick, '*', Block.netherrack }); NetherrackSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackShovel.png"); ModLoader.addName(NetherrackSpade, "Netherrack Shovel"); ModLoader.addRecipe(new ItemStack(NetherrackSpade, 1), new Object[] { " * ", " X ", " X ", 'X', Item.stick, '*', Block.netherrack }); NetherrackAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackAxe.png"); ModLoader.addName(NetherrackAxe, "Netherrack Axe"); ModLoader.addRecipe(new ItemStack(NetherrackAxe, 1), new Object[] { "** ", "*X ", " X ", 'X', Item.stick, '*', Block.netherrack }); NetherrackHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackHoe.png"); ModLoader.addName(NetherrackHoe, "Netherrack Hoe"); ModLoader.addRecipe(new ItemStack(NetherrackHoe), new Object[] { "** ", " X ", " X ", 'X', Item.stick, '*', Block.netherrack }); //Add items to inventory here. BoneSword.setCreativeTab(CreativeTabs.tabCombat); BonePickaxe.setCreativeTab(CreativeTabs.tabTools); BoneSpade.setCreativeTab(CreativeTabs.tabTools); BoneAxe.setCreativeTab(CreativeTabs.tabTools); BoneHoe.setCreativeTab(CreativeTabs.tabTools); BlazeSword.setCreativeTab(CreativeTabs.tabCombat); BlazePickaxe.setCreativeTab(CreativeTabs.tabTools); BlazeSpade.setCreativeTab(CreativeTabs.tabTools); BlazeAxe.setCreativeTab(CreativeTabs.tabTools); BlazeHoe.setCreativeTab(CreativeTabs.tabTools); EmeraldSword.setCreativeTab(CreativeTabs.tabCombat); EmeraldPickaxe.setCreativeTab(CreativeTabs.tabTools); EmeraldSpade.setCreativeTab(CreativeTabs.tabTools); EmeraldAxe.setCreativeTab(CreativeTabs.tabTools); EmeraldHoe.setCreativeTab(CreativeTabs.tabTools); NetherrackSword.setCreativeTab(CreativeTabs.tabCombat); NetherrackPickaxe.setCreativeTab(CreativeTabs.tabTools); NetherrackSpade.setCreativeTab(CreativeTabs.tabTools); NetherrackAxe.setCreativeTab(CreativeTabs.tabTools); NetherrackHoe.setCreativeTab(CreativeTabs.tabTools); } public String getVersion() { //Make sure to return the correct version. return "MoreTools v.0.01"; } } //A Blokster Studios Creation. Do not steal!ItemBlazeSword
package net.minecraft.src; public class ItemBlazeSword extends ItemSword { public ItemBlazeSword(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, par2EnumToolMaterial); } public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { entityliving.setFire(20); return true; } public boolean hasEffect(ItemStack par1ItemStack){ return true; } public String getItemDisplayName(ItemStack par1ItemStack){ String var2 = ("\u00a74" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim(); return var2; } }ItemNetherrackSword
package net.minecraft.src; public class ItemNetherrackSword extends ItemSword { public ItemNetherrackSword(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, par2EnumToolMaterial); } public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { entityliving.setFire(10); return true; } public boolean hasEffect(ItemStack par1ItemStack){ return true; } public String getItemDisplayName(ItemStack par1ItemStack){ String var2 = ("\u00a74" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim(); return var2; } }EnumToolMaterial
package net.minecraft.src; public enum EnumToolMaterial { 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), BONE(1, 85, 3.0F, 1, 15), BLAZE(2, 450, 5.0F, 2, 5), GREEN(3, 2561, 8.0F, 3, 22), RACK(1, 100, 6.0F, 1, 5); /** * 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 EnumToolMaterial(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)))); } }I got it fixed, it turns out my IDs were wrong. :/
Haha Oops!
Make a new mod_MOB and copy the code, but make a new ID, Texture, ModelMOB, etc.
There should be some info in the Diamond ore class, if you can't find it I'll make a tutorial
Glad they help!
I will make a tutorial on that when I learn it in Minecraft Forge
You don't get any error correct? You didn't make a new class for your mob like how we did in our tutorial?
I will add that to out list, or you can see the EntityPigmen to see how to do it yourself
Alright! added to my list
Added to my list
Added to my list
I was able to fix the problem, it turns out my IDs were wrong.
I will update that =)
protected void dropRareDrop(int par1) { this.dropItem(Item.ingotGold.shiftedIndex, 1); }Here's a code in order to drop an item but rarely, I got it from the entitypigZombie class. Hopefully that helps
My generate code located within my mod_ file:
//This generates Restructed pillers, these contain useful items and materials. public void generateSurface(World world, Random random, int i, int j) { if (random.nextInt(200) == 0) { int k = 0; for (int l = 86; l > 1; l--) { if (world.getBlockId(i, l, j) == 0 && world.getBlockId(i, l - 1, j) != 0) { k = l; } } for (int i1 = k; i1 < k + 40; i1++) { for (int l1 = 0; l1 < 10; l1++) { for (int k2 = 0; k2 < 10; k2++) { int j3 = Block.waterMoving.blockID; if (random.nextInt(4) == 0) { j3 = Block.oreRedstone.blockID; } world.setBlock(i + l1, i1, j + k2, j3); } } } for (int j1 = k + 1; j1 < k + 39; j1++) { for (int i2 = 1; i2 < 9; i2++) { for (int l2 = 1; l2 < 9; l2++) { world.setBlock(i + i2, j1, j + l2, 0); } } } for (int k1 = 0; k1 < 7; k1++) { world.setBlock(i + 1, k + 38, j + 1, Block.torchWood.blockID); world.setBlock(i + 8, k + 38, j + 8, Block.torchWood.blockID); world.setBlock(i + 8, k + 38, j + 1, Block.torchWood.blockID); world.setBlock(i + 1, k + 38, j + 8, Block.torchWood.blockID); } world.setBlock(i + 5, k + 1, j + 5, Block.chest.blockID); world.setBlock(i + 5, k + 2, j + 5, Block.mobSpawner.blockID); TileEntityChest tileentitychest = new TileEntityChest(); world.setBlockTileEntity(i + 5, k + 1, j + 5, tileentitychest); tileentitychest.setInventorySlotContents(1, new ItemStack(CronoRiggers.shiftedIndex, 1, 0)); tileentitychest.setInventorySlotContents(2, new ItemStack(Item.diamond.shiftedIndex, 8, 0)); tileentitychest.setInventorySlotContents(3, new ItemStack(Item.porkCooked.shiftedIndex, 30, 0)); tileentitychest.setInventorySlotContents(4, new ItemStack(Block.planks.blockID, 30, 0)); TileEntityMobSpawner tileentitymobspawner = new TileEntityMobSpawner(); world.setBlockTileEntity(i + 5, k + 8, j + 5, tileentitymobspawner); tileentitymobspawner.setMobID(pickMobSpawner(random));} } private String pickMobSpawner(Random random) { int i = random.nextInt(4); if (i == 0) { return "Kyurem"; } if (i == 1) { return "Shrival"; } if (i == 2) { return "Zombie"; } if (i == 3) { return "Skeleton"; } else { return ""; }One problem with your code is that a mob id an int, not a String.
An int? You mean as in I need to place an ID in the place of the String as in the name of the mob? or the public string needs to be public int?