I'm trying to make a titanium block out of 9 titanium rods and when I go to craft I get this error.
java.lang.NullPointerException
at net.minecraft.src.ItemStack.getIconIndex(ItemStack.java:105)
at net.minecraft.src.RenderItem.renderItemIntoGUI(RenderItem.java:270)
at net.minecraft.src.GuiContainer.drawSlotInventory(GuiContainer.java:228)
at net.minecraft.src.GuiContainer.drawScreen(GuiContainer.java:74)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1008)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
Mod_ File
package net.minecraft.src;
import java.util.Random;
public class mod_TorgsMod extends BaseMod
{
//Declaration
//Blocks
public static final Block BlockTitaniumSolid = (new BlockTitaniumSolid(200, ModLoader.addOverride("/terrain.png", "/Blocks/Titanium.png")).setHardness(5.0F).setResistance(10000.0f).setBlockName("TitaniumSolid"));
public static final Block BlockTitanium = (new BlockTitanium(201, ModLoader.addOverride("/terrain.png", "/Blocks/TitaniumOre.png")).setHardness(5.0F).setResistance(10000.0f).setBlockName("TitaniumOre"));
//Items
public static final Item ItemTitaniumBar = (new ItemTitaniumBar(15000).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumBar.png")).setItemName("TitaniumBar"));
//Tools
public static final Item TitaniumPickaxe = (new TorgsModToolPickAxe(16000, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png","/items/TitaniumPickaxe.png")).setItemName("TitaniumPickaxe"));
public static final Item TitaniumSpade = (new TorgsModToolSpade(16001, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumShovel.png")).setItemName("TitaniumShovel"));
public static final Item TitaniumAxe = (new TorgsModToolAxe(16002, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumAxe.png")).setItemName("TitaniumAxe"));
public static final Item TitaniumSword = (new TorgsModToolSword(16003, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumSword.png")).setItemName("TitaniumSword"));
//Armor
public static final Item TitaniumHelmet = (new TorgsModArmorItem(17000,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 0)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumHelmet.png")).setItemName("TitaniumHelmet");
public static final Item TitaniumChest = (new TorgsModArmorItem(17001,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 1)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumChest.png")).setItemName("TitaniumChest");
public static final Item TitaniumLegs = (new TorgsModArmorItem(17002,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 2)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumLegs.png")).setItemName("TitaniumLegs");
public static final Item TitaniumFeet = (new TorgsModArmorItem(17003,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumFeet.png")).setItemName("TitaniumFeet");
public void load()
{
ModLoader.registerBlock(BlockTitanium);
ModLoader.addName(BlockTitanium, "Titanium Ore");
ModLoader.addName(ItemTitaniumBar, "Titanium Bar");
ModLoader.addName(TitaniumPickaxe, "Titanium Pickaxe");
ModLoader.addName(TitaniumSpade, "Titanium Spade");
ModLoader.addName(TitaniumAxe, "Titanium Axe");
ModLoader.addName(TitaniumSword, "Titanium Sword");
ModLoader.addName(TitaniumHelmet, "Titanium Helmet");
ModLoader.addName(TitaniumChest, "Titanium Chest");
ModLoader.addName(TitaniumLegs, "Titanium Legs");
ModLoader.addName(TitaniumFeet, "Titanium Feet");
ModLoader.addName(BlockTitaniumSolid, "Block Of Titanium");
//Craft
ModLoader.addRecipe(new ItemStack(TitaniumPickaxe, 1), (new Object[]{"XXX"," Y "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumSpade, 1), (new Object[]{" X "," Y "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumAxe, 1), (new Object[]{" XX"," YX"," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumSword, 1), (new Object[]{" X "," X "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumHelmet, 1), (new Object[]{"XXX","X X", Character.valueOf('X'), ItemTitaniumBar}));
ModLoader.addRecipe(new ItemStack(TitaniumChest, 1), (new Object[]{"X X","XXX", "XXX" , Character.valueOf('X'), ItemTitaniumBar}));
ModLoader.addRecipe(new ItemStack(TitaniumLegs, 1), (new Object[]{"XXX","X X", "X X", Character.valueOf('X'), ItemTitaniumBar}));
ModLoader.addRecipe(new ItemStack(BlockTitaniumSolid, 1), (new Object[]{"XXX","XXX","XXX", Character.valueOf('X'), ItemTitaniumBar}));
//Smelt
ModLoader.addSmelting(BlockTitanium.blockID, new ItemStack(ItemTitaniumBar, 1));
world = ModLoader.getMinecraftInstance().theWorld;
}
private World world;
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int a= 0; a < 20; a++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(64);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_TorgsMod.BlockTitanium.blockID, 40)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
If you need the Block Source here it is.
package net.minecraft.src;
import java.util.Random;
public class BlockTitaniumSolid extends Block
{
public BlockTitaniumSolid(int i, int j)
{
super(i, j, Material.rock);
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random, int j)
{
return mod_TorgsMod.BlockTitaniumSolid.blockID;
}
}
and if you need anything else let me know. Everything else works perfectly.
Can you do a tut on how to make a non food item heal you or give you a potion effect or shoot lightning or blow **** up? kinda like a magic wand?
You mean like a wand that fire's something that blows up? I know how to do that! But having multiple effect would be hard :/
mod_ExplosionWand.java
package net.minecraft.src;
public class mod_ExplosionWand extends BaseMod
{
public static final Item ExplosionWand = new ItemExplosionWand(IdHere).setItemName("ExplosionWand").setIconCoord(5, 3).setFull3D(); //The icon cords are just for a stick.
public void load()
{
ModLoader.addName(ExplosionWand, "Explosion Wand");
ModLoader.addRecipe(new ItemStack(ExplosionWand, 1), new Object [] {"#", "#", "\", Character.valueOf('#'), Block.tnt, Character.valueOf('\'), Item.stick});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemExplosionWand.java
package net.minecraft.src;
import java.util.Random;
public class ItemExplosionWand extends Item
{
public ItemExplosionWand(int par1)
{
super(par1);
maxStackSize = 64;
}
/**
* 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)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
par1ItemStack.stackSize--;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityExplosionWand(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
}
EntityExplosionWand.java
package net.minecraft.src;
import java.util.Random;
public class EntityExplosionWand extends EntityThrowable
{
public EntityExplosionWand(World par1World)
{
super(par1World);
}
public EntityExplosionWand(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityExplosionWand(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when the throwable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), 0));
}
if (!worldObj.isRemote)
{
for (int counter = 0; counter < 1; counter++)
{
worldObj.createExplosion(this, posX, posY, posZ, 3F);
}
}
for (int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
if (!worldObj.isRemote)
{
setDead();
}
}
}
I'm trying to make a titanium block out of 9 titanium rods and when I go to craft I get this error.
java.lang.NullPointerException
at net.minecraft.src.ItemStack.getIconIndex(ItemStack.java:105)
at net.minecraft.src.RenderItem.renderItemIntoGUI(RenderItem.java:270)
at net.minecraft.src.GuiContainer.drawSlotInventory(GuiContainer.java:228)
at net.minecraft.src.GuiContainer.drawScreen(GuiContainer.java:74)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1008)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
Mod_ File
package net.minecraft.src;
import java.util.Random;
public class mod_TorgsMod extends BaseMod
{
//Declaration
//Blocks
public static final Block BlockTitaniumSolid = (new BlockTitaniumSolid(200, ModLoader.addOverride("/terrain.png", "/Blocks/Titanium.png")).setHardness(5.0F).setResistance(10000.0f).setBlockName("TitaniumSolid"));
public static final Block BlockTitanium = (new BlockTitanium(201, ModLoader.addOverride("/terrain.png", "/Blocks/TitaniumOre.png")).setHardness(5.0F).setResistance(10000.0f).setBlockName("TitaniumOre"));
//Items
public static final Item ItemTitaniumBar = (new ItemTitaniumBar(15000).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumBar.png")).setItemName("TitaniumBar"));
//Tools
public static final Item TitaniumPickaxe = (new TorgsModToolPickAxe(16000, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png","/items/TitaniumPickaxe.png")).setItemName("TitaniumPickaxe"));
public static final Item TitaniumSpade = (new TorgsModToolSpade(16001, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumShovel.png")).setItemName("TitaniumShovel"));
public static final Item TitaniumAxe = (new TorgsModToolAxe(16002, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumAxe.png")).setItemName("TitaniumAxe"));
public static final Item TitaniumSword = (new TorgsModToolSword(16003, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumSword.png")).setItemName("TitaniumSword"));
//Armor
public static final Item TitaniumHelmet = (new TorgsModArmorItem(17000,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 0)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumHelmet.png")).setItemName("TitaniumHelmet");
public static final Item TitaniumChest = (new TorgsModArmorItem(17001,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 1)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumChest.png")).setItemName("TitaniumChest");
public static final Item TitaniumLegs = (new TorgsModArmorItem(17002,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 2)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumLegs.png")).setItemName("TitaniumLegs");
public static final Item TitaniumFeet = (new TorgsModArmorItem(17003,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumFeet.png")).setItemName("TitaniumFeet");
public void load()
{
ModLoader.registerBlock(BlockTitanium);
ModLoader.addName(BlockTitanium, "Titanium Ore");
ModLoader.addName(ItemTitaniumBar, "Titanium Bar");
ModLoader.addName(TitaniumPickaxe, "Titanium Pickaxe");
ModLoader.addName(TitaniumSpade, "Titanium Spade");
ModLoader.addName(TitaniumAxe, "Titanium Axe");
ModLoader.addName(TitaniumSword, "Titanium Sword");
ModLoader.addName(TitaniumHelmet, "Titanium Helmet");
ModLoader.addName(TitaniumChest, "Titanium Chest");
ModLoader.addName(TitaniumLegs, "Titanium Legs");
ModLoader.addName(TitaniumFeet, "Titanium Feet");
ModLoader.addName(BlockTitaniumSolid, "Block Of Titanium");
//Craft
ModLoader.addRecipe(new ItemStack(TitaniumPickaxe, 1), (new Object[]{"XXX"," Y "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumSpade, 1), (new Object[]{" X "," Y "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumAxe, 1), (new Object[]{" XX"," YX"," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumSword, 1), (new Object[]{" X "," X "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick}));
ModLoader.addRecipe(new ItemStack(TitaniumHelmet, 1), (new Object[]{"XXX","X X", Character.valueOf('X'), ItemTitaniumBar}));
ModLoader.addRecipe(new ItemStack(TitaniumChest, 1), (new Object[]{"X X","XXX", "XXX" , Character.valueOf('X'), ItemTitaniumBar}));
ModLoader.addRecipe(new ItemStack(TitaniumLegs, 1), (new Object[]{"XXX","X X", "X X", Character.valueOf('X'), ItemTitaniumBar}));
ModLoader.addRecipe(new ItemStack(BlockTitaniumSolid, 1), (new Object[]{"XXX","XXX","XXX", Character.valueOf('X'), ItemTitaniumBar}));
//Smelt
ModLoader.addSmelting(BlockTitanium.blockID, new ItemStack(ItemTitaniumBar, 1));
world = ModLoader.getMinecraftInstance().theWorld;
}
private World world;
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int a= 0; a < 20; a++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(64);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_TorgsMod.BlockTitanium.blockID, 40)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
If you need the Block Source here it is.
package net.minecraft.src;
import java.util.Random;
public class BlockTitaniumSolid extends Block
{
public BlockTitaniumSolid(int i, int j)
{
super(i, j, Material.rock);
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random, int j)
{
return mod_TorgsMod.BlockTitaniumSolid.blockID;
}
}
and if you need anything else let me know. Everything else works perfectly.
You didn't register BlockTitaniumSolid.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I didn't really do anything yet, except do the 'Getting Set-Up' part.
Up until it said 'All of the decompiled Minecraft files will be in mcp61/src/net/minecraft/src.', everything was fine. But when I checked /src/, no folders. Completely empty. Now I'm confused about this, and I'm checking other (video) tutorials, and all of them have a folder in it (with the same thing inside). I didn't start coding yet, and followed all your instructions. What happened?
Hello, I have a question. I have a mob working and appearing. It attacks me and jumps and everything. I have a few questions though:
1. How to make some of the body parts to move? I know it's somewhere in model****.java, but I don't know what exactly.
2. How to make them like wolves who are neutral then becomes hostile when provoked?
3. Final question, how to make the mob act like the wolves in packs, when once a wolf is hurt, all of them will attack.
Thanks!
BTW, thanks MICHAELNESS for the help.
The setRotationAngles method in ModelBiped or ModelQuadruped.
Look at the wolf's entity class
Look at the wolf's entity class.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Techguy, how do I get a mob so spawn a structure? I've tried but I can't seem to get it to work :/
I'd also like to know how to get new mobs fight off other hostiles.
I'm not sure what you mean. Do you mean that it generates a stucture at its location?
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Yeah, sort of. Every so often (rarely, actually), I want the entity to look like it's building, then a structure is spawned relative to it's current location.
The setRotationAngles method in ModelBiped or ModelQuadruped.
Look at the wolf's entity class
Look at the wolf's entity class.
Hey, about the neutral unless provoked thing, you said in your tutorial that only EntityMob can have damage, but EntityMob always attack the player. How to make them neutral unless provoked? Or there any other way?
Yeah, sort of. Every so often (rarely, actually), I want the entity to look like it's building, then a structure is spawned relative to it's current location.
Hmm, I'm not sure sorry. Try asking in Mod Development.
Hey, about the neutral unless provoked thing, you said in your tutorial that only EntityMob can have damage, but EntityMob always attack the player. How to make them neutral unless provoked? Or there any other way?
When modding, if you're not sure how to do something, always think to yourself, "Is this done in the game already?". Then, if it is, you just go and find the class for what it is you want to do. For example, you want a neutral mob. Pig zombies are also neutral. EntityPigZombie.java will show you how to do what you want to do. MCP also includes what all the methods are used for now, so the comments in the code should help you.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hmm, I'm not sure sorry. Try asking in Mod Development.
When modding, if you're not sure how to do something, always think to yourself, "Is this done in the game already?". Then, if it is, you just go and find the class for what it is you want to do. For example, you want a neutral mob. Pig zombies are also neutral. EntityPigZombie.java will show you how to do what you want to do. MCP also includes what all the methods are used for now, so the comments in the code should help you.
Whoa! Thank you very much! Pigzombie was the last thing in my mind because I rarely even go to the nether. I'll take that tip! Thanks!
If you are making your own mob then you can do it without editing base classes. But if you just want to make the default mobs not burn you can go to EntityZombie (or EntitySkeliton or whatever) and make if so that it extends something like EntityNoSun then just make a new file named EntityNoSun, copy the code from EntityMob, and take out the chunk of code that tells it not to spawn in the daytime, and the chunk that tells it to burn. Or you could just take all that code out of EntityMob.
Is there any way you can explain a bit more, like which code I'd have to remove... Also, why wouldn't creepers burn if that is the problem? Or maybe TechGuy can help a bit? BTW, I am using an already existing mob
Is there a way that I can compress all my custom blocks into one file like the Block.java? Also items? All the Block are Ores and the items Ingots.
I don't see why you would need to, the many Block or Item files will in no way lag your game, but having multiple mod_ files will. So why do you need to?
Mod_ File
package net.minecraft.src; import java.util.Random; public class mod_TorgsMod extends BaseMod { //Declaration //Blocks public static final Block BlockTitaniumSolid = (new BlockTitaniumSolid(200, ModLoader.addOverride("/terrain.png", "/Blocks/Titanium.png")).setHardness(5.0F).setResistance(10000.0f).setBlockName("TitaniumSolid")); public static final Block BlockTitanium = (new BlockTitanium(201, ModLoader.addOverride("/terrain.png", "/Blocks/TitaniumOre.png")).setHardness(5.0F).setResistance(10000.0f).setBlockName("TitaniumOre")); //Items public static final Item ItemTitaniumBar = (new ItemTitaniumBar(15000).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumBar.png")).setItemName("TitaniumBar")); //Tools public static final Item TitaniumPickaxe = (new TorgsModToolPickAxe(16000, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png","/items/TitaniumPickaxe.png")).setItemName("TitaniumPickaxe")); public static final Item TitaniumSpade = (new TorgsModToolSpade(16001, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumShovel.png")).setItemName("TitaniumShovel")); public static final Item TitaniumAxe = (new TorgsModToolAxe(16002, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumAxe.png")).setItemName("TitaniumAxe")); public static final Item TitaniumSword = (new TorgsModToolSword(16003, TorgsModToolMaterial.TITANIUM).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumSword.png")).setItemName("TitaniumSword")); //Armor public static final Item TitaniumHelmet = (new TorgsModArmorItem(17000,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 0)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumHelmet.png")).setItemName("TitaniumHelmet"); public static final Item TitaniumChest = (new TorgsModArmorItem(17001,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 1)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumChest.png")).setItemName("TitaniumChest"); public static final Item TitaniumLegs = (new TorgsModArmorItem(17002,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 2)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumLegs.png")).setItemName("TitaniumLegs"); public static final Item TitaniumFeet = (new TorgsModArmorItem(17003,TorgsModArmorMaterial.TITANIUM, ModLoader.addArmor("titanium"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/items/TitaniumFeet.png")).setItemName("TitaniumFeet"); public void load() { ModLoader.registerBlock(BlockTitanium); ModLoader.addName(BlockTitanium, "Titanium Ore"); ModLoader.addName(ItemTitaniumBar, "Titanium Bar"); ModLoader.addName(TitaniumPickaxe, "Titanium Pickaxe"); ModLoader.addName(TitaniumSpade, "Titanium Spade"); ModLoader.addName(TitaniumAxe, "Titanium Axe"); ModLoader.addName(TitaniumSword, "Titanium Sword"); ModLoader.addName(TitaniumHelmet, "Titanium Helmet"); ModLoader.addName(TitaniumChest, "Titanium Chest"); ModLoader.addName(TitaniumLegs, "Titanium Legs"); ModLoader.addName(TitaniumFeet, "Titanium Feet"); ModLoader.addName(BlockTitaniumSolid, "Block Of Titanium"); //Craft ModLoader.addRecipe(new ItemStack(TitaniumPickaxe, 1), (new Object[]{"XXX"," Y "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick})); ModLoader.addRecipe(new ItemStack(TitaniumSpade, 1), (new Object[]{" X "," Y "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick})); ModLoader.addRecipe(new ItemStack(TitaniumAxe, 1), (new Object[]{" XX"," YX"," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick})); ModLoader.addRecipe(new ItemStack(TitaniumSword, 1), (new Object[]{" X "," X "," Y ", Character.valueOf('X'), ItemTitaniumBar, Character.valueOf('Y'), Item.stick})); ModLoader.addRecipe(new ItemStack(TitaniumHelmet, 1), (new Object[]{"XXX","X X", Character.valueOf('X'), ItemTitaniumBar})); ModLoader.addRecipe(new ItemStack(TitaniumChest, 1), (new Object[]{"X X","XXX", "XXX" , Character.valueOf('X'), ItemTitaniumBar})); ModLoader.addRecipe(new ItemStack(TitaniumLegs, 1), (new Object[]{"XXX","X X", "X X", Character.valueOf('X'), ItemTitaniumBar})); ModLoader.addRecipe(new ItemStack(BlockTitaniumSolid, 1), (new Object[]{"XXX","XXX","XXX", Character.valueOf('X'), ItemTitaniumBar})); //Smelt ModLoader.addSmelting(BlockTitanium.blockID, new ItemStack(ItemTitaniumBar, 1)); world = ModLoader.getMinecraftInstance().theWorld; } private World world; public void generateSurface(World world, Random rand, int chunkX, int chunkZ) { for(int a= 0; a < 20; a++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(64); int randPosZ = chunkZ + rand.nextInt(16); (new WorldGenMinable(mod_TorgsMod.BlockTitanium.blockID, 40)).generate(world, rand, randPosX, randPosY, randPosZ); } } public String getVersion() { return "1.2.5"; } }If you need the Block Source here it is.
package net.minecraft.src; import java.util.Random; public class BlockTitaniumSolid extends Block { public BlockTitaniumSolid(int i, int j) { super(i, j, Material.rock); } public int quantityDropped(Random random) { return 1; } public int idDropped(int i, Random random, int j) { return mod_TorgsMod.BlockTitaniumSolid.blockID; } }and if you need anything else let me know. Everything else works perfectly.
Visit my dragon
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou mean like a wand that fire's something that blows up? I know how to do that! But having multiple effect would be hard :/
mod_ExplosionWand.java
package net.minecraft.src; public class mod_ExplosionWand extends BaseMod { public static final Item ExplosionWand = new ItemExplosionWand(IdHere).setItemName("ExplosionWand").setIconCoord(5, 3).setFull3D(); //The icon cords are just for a stick. public void load() { ModLoader.addName(ExplosionWand, "Explosion Wand"); ModLoader.addRecipe(new ItemStack(ExplosionWand, 1), new Object [] {"#", "#", "\", Character.valueOf('#'), Block.tnt, Character.valueOf('\'), Item.stick}); } public String getVersion() { return "1.2.5"; } }ItemExplosionWand.java
package net.minecraft.src; import java.util.Random; public class ItemExplosionWand extends Item { public ItemExplosionWand(int par1) { super(par1); maxStackSize = 64; } /** * 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) { if (!par3EntityPlayer.capabilities.isCreativeMode) { par1ItemStack.stackSize--; } par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityExplosionWand(par2World, par3EntityPlayer)); } return par1ItemStack; } }EntityExplosionWand.java
package net.minecraft.src; import java.util.Random; public class EntityExplosionWand extends EntityThrowable { public EntityExplosionWand(World par1World) { super(par1World); } public EntityExplosionWand(World par1World, EntityLiving par2EntityLiving) { super(par1World, par2EntityLiving); } public EntityExplosionWand(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when the throwable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), 0)); } if (!worldObj.isRemote) { for (int counter = 0; counter < 1; counter++) { worldObj.createExplosion(this, posX, posY, posZ, 3F); } } for (int i = 0; i < 8; i++) { worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D); } if (!worldObj.isRemote) { setDead(); } } }I hope I helped
You didn't register BlockTitaniumSolid.
together they are powerful beyond imagination."
Up until it said 'All of the decompiled Minecraft files will be in mcp61/src/net/minecraft/src.', everything was fine.
But when I checked /src/, no folders. Completely empty. Now I'm confused about this, and I'm checking other (video) tutorials, and all of them have a folder in it (with the same thing inside). I didn't start coding yet, and followed all your instructions. What happened?
I dare you to click it.
Now it works
I dare you to click it.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'd also like to know how to get new mobs fight off other hostiles.
I'm not sure what you mean. Do you mean that it generates a stucture at its location?
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumHey, about the neutral unless provoked thing, you said in your tutorial that only EntityMob can have damage, but EntityMob always attack the player. How to make them neutral unless provoked? Or there any other way?
Hmm, I'm not sure sorry. Try asking in Mod Development.
When modding, if you're not sure how to do something, always think to yourself, "Is this done in the game already?". Then, if it is, you just go and find the class for what it is you want to do. For example, you want a neutral mob. Pig zombies are also neutral. EntityPigZombie.java will show you how to do what you want to do. MCP also includes what all the methods are used for now, so the comments in the code should help you.
together they are powerful beyond imagination."
Visit my dragon
Whoa! Thank you very much! Pigzombie was the last thing in my mind because I rarely even go to the nether. I'll take that tip! Thanks!
Is there any way you can explain a bit more, like which code I'd have to remove... Also, why wouldn't creepers burn if that is the problem? Or maybe TechGuy can help a bit? BTW, I am using an already existing mob
I don't see why you would need to, the many Block or Item files will in no way lag your game, but having multiple mod_ files will. So why do you need to?