I've been trying to make a new bomb-like block in my mod, and i have a problem with it......
package net.minecraft.src;
public class BlockM1n3cra4tBomb extends Block
{
public BlockM1n3cra4tBomb(int i, int j)
{
super(i, j, Material.tnt);
}
public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l)
{
world.createExplosion(null, i, j, k, 10F);
}
public void onBlockDestroyedByExplosion(World world, int i, int j, int k, int l)
{
world.createExplosion(null, i, j, k, 10F);
}
}
I wanted to make my block explode when it is destroyed by explosion, but it just drops!
How do I make it explode by an explosion?
Either look at how TNT works, or go and ask in Mod Development. I have not covered explosive blocks in my tutorials, so I'm not helping with problems with them.
Thanks everyone who told me how to reobfuscate and post pictures come check out my mod it's called Extra Food Mod.
Here's the link to the post:http://www.minecraft...__fromsearch__1
If that didn't work try typing in: Extra Food Mod or Food Mod
Also are the flowers supposed to spawn?
If not can we put this code into the flower to make it spawn:
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int i = 0; i < 37; i++)
{
int randPosX = chunkX + rand.nextInt(5);
int randPosY = rand.nextInt(80);
int randPosZ = chunkZ + rand.nextInt(5);
(new WorldGenMinable(mod_ManaOre.ManaOre.blockID, 17)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
With an If statement saying find grass to spawn on?
Maybe, I'm not really sure. Try it and you might find out if it works or not.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Can you make a tut on how to make an ingot out of the crafting table? Cause I can't seem to do it nor can I find one. Everytime I try it I get a block.
to reply to my older post i have it the texture in C:\Users\ \Desktop\my modding fold\tools\mcp62\temp\bin\minecraft\gold.png
and in C:\Users\ \Desktop\my modding fold\tools\mcp62\eclipse\Client\bin\gold.png
and a snippet of my texture code is :
goldencake.iconIndex = ModLoader.addOverride( "/gui/items.png", "/gold.png"); thanks for even trying to help an inexperienced modder
Can you make a tut on how to make an ingot out of the crafting table? Cause I can't seem to do it nor can I find one. Everytime I try it I get a block.
Please post your code. I will be able to give you better instructions if you do so. Basically, you need to say "new ItemStack(Item.ingotIron, 1)". That is an example, where you would replace the Item with the file you are referencing (mod_example, Item, Block, etc.) and the ingotIron with what you want to craft (ingotGold, Stone, etc.) and the number would be how many you want to craft.Hey, TechGuy, I would be willing to set up the tools tutorial for you. I am experienced with making new tools, without editing base classes whatsoever.
to reply to my older post i have it the texture in C:\Users\ \Desktop\my modding fold\tools\mcp62\temp\bin\minecraft\gold.png
and in C:\Users\ \Desktop\my modding fold\tools\mcp62\eclipse\Client\bin\gold.png
and a snippet of my texture code is :
goldencake.iconIndex = ModLoader.addOverride( "/gui/items.png", "/gold.png"); thanks for even trying to help an inexperienced modder
I don't know what's wrong. One suggestion is that you can post or send me your code, and I will troubleshoot for you. I will not steal or in any other way share your code with anyone else. My only other advice would be to recompile and reobfuscate your mod, and then install it in your minecraft.jar with the pictures, and see if you still get the same error.
I recompiled with the redstone dragon, it worked. But when I run startclient.bat it gives me this error:
Mods loaded: 2
ModLoader 1.2.5
mod_RedstonePlus 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT b96bcc64 --------
Generated 6-4-12 19:57
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_01, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: Intel 965/963 Graphics Media Accelerator version 2.0.0 - Build 8.14.10.1930, Intel
java.lang.Exception: No registry for this texture: [size=large][b]gui/items.png[/b][/size]
at net.minecraft.src.ModLoader.getUniqueSpriteIndex(ModLoader.java:675)
at net.minecraft.src.ModLoader.addOverride(ModLoader.java:365)
at net.minecraft.src.mod_RedstonePlus.load(mod_RedstonePlus.java:61)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 682ead36 ----------
I THINK it needs to be /gui/items.png and not gui/items.png
not sure though!
--- BEGIN ERROR REPORT 4d7bb5e1 --------
Generated 4/6/12 5:31 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.6.8
Java: 1.6.0_29, Apple Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: NVIDIA GeForce 9400 OpenGL Engine version 2.1 NVIDIA-1.6.36, NVIDIA Corporation
java.lang.RuntimeException: java.lang.Exception: Image not found: /hardeneddiamond.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.Exception: Image not found: /hardeneddiamond.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 74af04aa ----------
The code
package net.minecraft.src;
import java.util.Random;
public class Blockhdblock extends Block
{
public void Blockhdblock(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.hdblock.block160;
}
public int quantityDropped(Random random)
{
return 1;
}}
package net.minecraft.src;
public class mod_hdBlock extends BaseMod
{
public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F);
public void load()
{
hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png");
ModLoader.registerBlock(hdblock);
ModLoader.addName(hdblock, "Hardened Diamond Block");
ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] {
"XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond});
}
public String getVersion()
{
return "1.2.5";
}
}
--- BEGIN ERROR REPORT 4d7bb5e1 --------
Generated 4/6/12 5:31 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.6.8
Java: 1.6.0_29, Apple Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: NVIDIA GeForce 9400 OpenGL Engine version 2.1 NVIDIA-1.6.36, NVIDIA Corporation
java.lang.RuntimeException: java.lang.Exception: Image not found: /hardeneddiamond.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.Exception: Image not found: /hardeneddiamond.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 74af04aa ----------
The code
package net.minecraft.src;
import java.util.Random;
public class Blockhdblock extends Block
{
public void Blockhdblock(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.hdblock.block160;
}
public int quantityDropped(Random random)
{
return 1;
}}
package net.minecraft.src;
public class mod_hdBlock extends BaseMod
{
public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F);
public void load()
{
hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png");
ModLoader.registerBlock(hdblock);
ModLoader.addName(hdblock, "Hardened Diamond Block");
ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] {
"XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond});
}
public String getVersion()
{
return "1.2.5";
}
}
If you look in the error report you will see this "Caused by: java.lang.Exception: Image not found: /hardeneddiamond.png" this means that you don't have the image in the correct spot or you didn't link it correctly in you mod_ file or the image is named wrong.
[/spoiler]
If you look in the error report you will see this "Caused by: java.lang.Exception: Image not found: /hardeneddiamond.png" this means that you don't have the image in the correct spot or you didn't link it correctly in you mod_ file or the image is named wrong.
Where should i put them again, i have them in the "/mcp62/bin/minecraft/hardeneddiamond.png" folder, and the /mcp62/eclipse/Client/hardeneddiamond.png folder.
--- BEGIN ERROR REPORT 4d7bb5e1 --------
Generated 4/6/12 5:31 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.6.8
Java: 1.6.0_29, Apple Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: NVIDIA GeForce 9400 OpenGL Engine version 2.1 NVIDIA-1.6.36, NVIDIA Corporation
java.lang.RuntimeException: java.lang.Exception: Image not found: /hardeneddiamond.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.Exception: Image not found: /hardeneddiamond.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 74af04aa ----------
The code
package net.minecraft.src;
import java.util.Random;
public class Blockhdblock extends Block
{
public void Blockhdblock(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.hdblock.block160;
}
public int quantityDropped(Random random)
{
return 1;
}}
package net.minecraft.src;
public class mod_hdBlock extends BaseMod
{
public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F);
public void load()
{
hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png");
ModLoader.registerBlock(hdblock);
ModLoader.addName(hdblock, "Hardened Diamond Block");
ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] {
"XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond});
}
public String getVersion()
{
return "1.2.5";
}
}
It's not finding your image. Make sure your path is correct.
This is great for amateur modders! I know you're not accepting anymore requests at the moment but when you get the chance may you please do a dimension mod? I've spent a few hours trying to understand the code, I got a bit of it figured out but making the portal and the new file itself is confusing me.
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/hdblock.java:4: class Blockhdblock is public, should be declared in a file named Blockhdblock.java
public class Blockhdblock extends Block
^
src/minecraft/net/minecraft/src/hdblock.java:8: call to super must be first statement in constructor
super(i, j, Material.iron);
^
src/minecraft/net/minecraft/src/hdblock.java:14: package mod_Block does not exist
return mod_Block.hdblock.block160;
^
3 errors
==================
The code
package net.minecraft.src;
import java.util.Random;
public class Blockhdblock extends Block
{
public void Blockhdblock(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.hdblock.block160;
}
public int quantityDropped(Random random)
{
return 1;
}}
package net.minecraft.src;
public class mod_hdBlock extends BaseMod
{
public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F);
public void load()
{
hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png");
ModLoader.registerBlock(hdblock);
ModLoader.addName(hdblock, "Hardened Diamond Block");
ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] {
"XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond});
}
public String getVersion()
{
return "1.2.5";
}
}
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/hdblock.java:4: class Blockhdblock is public, should be declared in a file named Blockhdblock.java
public class Blockhdblock extends Block
^
src/minecraft/net/minecraft/src/hdblock.java:8: call to super must be first statement in constructor
super(i, j, Material.iron);
^
src/minecraft/net/minecraft/src/hdblock.java:14: package mod_Block does not exist
return mod_Block.hdblock.block160;
^
3 errors
==================
The code
package net.minecraft.src;
import java.util.Random;
public class Blockhdblock extends Block
{
public void Blockhdblock(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.hdblock.block160;
}
public int quantityDropped(Random random)
{
return 1;
}}
package net.minecraft.src;
public class mod_hdBlock extends BaseMod
{
public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F);
public void load()
{
hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png");
ModLoader.registerBlock(hdblock);
ModLoader.addName(hdblock, "Hardened Diamond Block");
ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] {
"XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond});
}
public String getVersion()
{
return "1.2.5";
}
}
I knew i had it in the right place, It gets the texture, but not if i run it through eclipse.
for your last error: don't put the number your block ID is, just put blockID and put "mod_hdBlock",instead of mod_Block, that should help you somewhat
Hey, TechGuy, I would be willing to set up the tools tutorial for you. I am experienced with making new tools, without editing base classes whatsoever.
I've got most of the tool tutorial done, but I've been busy with work so I haven't been able to post it. Thanks though.
Im sorry but my question went unanswered, how do i get my custom NPC to walk or fly? and not just slide about?
Have a look at the setRotationAngles method in ModelBiped.
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've been using your tutorials, and they've helped so much. They're great, thanks for making them.
I've run into a little problem, though. I am making, well updating, a mod of mine called Boss Mobs: Yeti. It adds Bosses to Minecraft, this particular part of the series adding the Yeti.
Well, everything was fine before, aside from some bugs, which is which this update was for. In the original, everything seemed to be spawning in the desert instead of the snow biomes I designated them to, and there were more than I had planned spawned in one area. So with this new version, I fixed that by copying some code from the Ghast so that it checks the biome and makes sure there is only one.
Now that everything is changed, I ran it from Eclipse and everything was perfect. As soon as I reob and try in actual Minecraft, though, nothing spawns at all, nor can I spawn it with SPC, even in proper snow biomes.
Here is the code that I use.
mod_Yeti
package net.minecraft.src;
import java.util.Map;
public class mod_Yeti extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(EntityYeti.class, "Yeti", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityYeti.class, 1, 1, 1, EnumCreatureType.creature);
ModLoader.registerEntityID(EntityHunter.class, "Hunter", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityHunter.class, 3, 3, 6, EnumCreatureType.creature);
}
public void addRenderer(Map map)
{
//Render and Model
map.put(EntityYeti.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(EntityHunter.class, new RenderBiped(new ModelBiped(), 0.5F));
//Spawning
ModLoader.addSpawn(EntityYeti.class, 2, 1, 4, EnumCreatureType.monster, new BiomeGenBase[]
{
BiomeGenBase.taiga,
BiomeGenBase.frozenOcean,
BiomeGenBase.frozenRiver,
BiomeGenBase.iceMountains,
BiomeGenBase.icePlains,
BiomeGenBase.taigaHills
});
ModLoader.addSpawn(EntityHunter.class, 2, 1, 4, EnumCreatureType.monster, new BiomeGenBase[]
{
BiomeGenBase.taiga,
BiomeGenBase.frozenOcean,
BiomeGenBase.frozenRiver,
BiomeGenBase.iceMountains,
BiomeGenBase.icePlains,
BiomeGenBase.taigaHills
});
}
public String getVersion()
{
return "1.2.5";
}
}
EntityYeti
package net.minecraft.src;
import java.util.Random;
public class EntityYeti extends EntityMob
{
public EntityYeti(World world)
{
super(world);
texture = "/yeti.png";
moveSpeed = 0.5F;
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityHunter.class, 16F, 0, true));
attackStrength = 10; //take this line out if this class doesn't extend EntityMob.
}
public int getMaxHealth()
{
return 25;
}
protected String getLivingSound()
{
return "mob.zombie";
}
protected String getHurtSound()
{
return "mob.zombiehurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return Block.ice.blockID;
}
/**
* Drop 0-2 items of this living's type
*/
protected void dropFewItems(boolean par1, int par2)
{
int i = rand.nextInt(3) + rand.nextInt(1 + par2);
for (int j = 0; j < i; j++)
{
dropItem(Block.ice.blockID, 1);
}
i = rand.nextInt(3) + 1 + rand.nextInt(1 + par2);
for (int k = 0; k < i; k++)
{
if (isBurning())
{
dropItem(Item.diamond.shiftedIndex, 1);
}
else
{
dropItem(Item.snowball.shiftedIndex, 4);
}
}
}
protected boolean canDespawn()
{
return false;
}
/**
* Checks if the entity's current position is a valid location to spawn this entity.
*/
public boolean getCanSpawnHere()
{
return rand.nextInt(20) == 0 && super.getCanSpawnHere() && worldObj.difficultySetting > 0;
}
/**
* Will return how many at most can spawn in a chunk at once.
*/
public int getMaxSpawnedInChunk()
{
return 1;
}
}
I also added a new mob to it, Hunters. They are supposed to attack the Yetis, and the Yetis are supposed to attack them. But they don't, not even in eclipse.
EntityHunter
package net.minecraft.src;
import java.util.Random;
public class EntityHunter extends EntityMob
{
public EntityHunter(World world)
{
super(world);
texture = "/hunter.png";
moveSpeed = 0.5F;
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityYeti.class, 16F, 0, true));
attackStrength = 4; //take this line out if this class doesn't extend EntityMob.
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Item.ingotGold.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.swordStone, 1);
}
private static final ItemStack defaultHeldItem;
/**
* Checks if the entity's current position is a valid location to spawn this entity.
*/
public boolean getCanSpawnHere()
{
return rand.nextInt(20) == 0 && super.getCanSpawnHere() && worldObj.difficultySetting > 0;
}
}
Yes, this was directed to the creator of these tutorials, but if you know the problem and can respond before him (ASAP), please go ahead, this has been frustrating me for hours.
ok i have a problem that i need answered right away. i have the mod coded right but it keeps crashing because it cant load the image and i coded it like the code on the tutorial. here is my code.
package net.minecraft.src;
public class mod_ObsidianApple extends BaseMod
{
public static final Item obsidianapple = new ItemFood(124, 20, 60F, true).setItemName("Obsidian Apple");
public void load()
{
obsidianapple.iconIndex = ModLoader.addOverride("/gui/items.png", "/mcp/eclipse/Client/bin/obsidianapple.png");
ModLoader.addName(obsidianapple, "Obsidian Apple");
ModLoader.addRecipe(new ItemStack(obsidianapple, 1), new Object [] {"@@@", "@#@", "@@@", Character.valueOf('#'), Item.appleRed, Character.valueOf('@'), Block.obsidian});
}
public String getVersion()
{
return "1.2.5";
}
}
Either look at how TNT works, or go and ask in Mod Development. I have not covered explosive blocks in my tutorials, so I'm not helping with problems with them.
Maybe, I'm not really sure. Try it and you might find out if it works or not.
My tutorial doesn't show how to make them spawn, simply how to make one.
Possibly.
I think PhantomJedi has answered everyone else's questions. Thanks PhantomJedi! If your question has gone unanswered, please let me know.
You need to import Map.
It isPost your recipe code if it isn't working.
together they are powerful beyond imagination."
and in C:\Users\ \Desktop\my modding fold\tools\mcp62\eclipse\Client\bin\gold.png
and a snippet of my texture code is :
goldencake.iconIndex = ModLoader.addOverride(
"/gui/items.png", "/gold.png");
thanks for even trying to help an inexperienced modder
yea it isnt working heres my class file for it.
package net.minecraft.src; public class mod_ironapple extends BaseMod { public static final Item ironapple = new ItemFood(125, 18, 15F, true).setItemName("Iron Apple"); public void load() { ironapple.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/image.png"); ModLoader.addName(ironapple, "Iron Apple"); ModLoader.addRecipe(new ItemStack(ironapple, 1), new Object [] {"###", "#@#", "###", Character.valueOf('#'), Item.ingotIron, Character.valueOf('@')Item.appleRed}); } public String getVersion() { return "1.2.5"; } }Please post your code. I will be able to give you better instructions if you do so. Basically, you need to say "new ItemStack(Item.ingotIron, 1)". That is an example, where you would replace the Item with the file you are referencing (mod_example, Item, Block, etc.) and the ingotIron with what you want to craft (ingotGold, Stone, etc.) and the number would be how many you want to craft.Hey, TechGuy, I would be willing to set up the tools tutorial for you. I am experienced with making new tools, without editing base classes whatsoever.
I don't know what's wrong. One suggestion is that you can post or send me your code, and I will troubleshoot for you. I will not steal or in any other way share your code with anyone else. My only other advice would be to recompile and reobfuscate your mod, and then install it in your minecraft.jar with the pictures, and see if you still get the same error.
I THINK it needs to be /gui/items.png and not gui/items.png
not sure though!
error report
The code
package net.minecraft.src; import java.util.Random; public class Blockhdblock extends Block { public void Blockhdblock(int i, int j) { super(i, j, Material.iron); } public int idDropped(int i, Random random, int j) { return mod_Block.hdblock.block160; } public int quantityDropped(Random random) { return 1; }}package net.minecraft.src; public class mod_hdBlock extends BaseMod { public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F); public void load() { hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png"); ModLoader.registerBlock(hdblock); ModLoader.addName(hdblock, "Hardened Diamond Block"); ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] { "XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond}); } public String getVersion() { return "1.2.5"; } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumWhere should i put them again, i have them in the "/mcp62/bin/minecraft/hardeneddiamond.png" folder, and the /mcp62/eclipse/Client/hardeneddiamond.png folder.
It's not finding your image. Make sure your path is correct.
error report
== ERRORS FOUND == src/minecraft/net/minecraft/src/hdblock.java:4: class Blockhdblock is public, should be declared in a file named Blockhdblock.java public class Blockhdblock extends Block ^ src/minecraft/net/minecraft/src/hdblock.java:8: call to super must be first statement in constructor super(i, j, Material.iron); ^ src/minecraft/net/minecraft/src/hdblock.java:14: package mod_Block does not exist return mod_Block.hdblock.block160; ^ 3 errors ==================The code
package net.minecraft.src; import java.util.Random; public class Blockhdblock extends Block { public void Blockhdblock(int i, int j) { super(i, j, Material.iron); } public int idDropped(int i, Random random, int j) { return mod_Block.hdblock.block160; } public int quantityDropped(Random random) { return 1; }}package net.minecraft.src; public class mod_hdBlock extends BaseMod { public static final Block hdblock = new Blockhdblock().setBlockName("wtflolhaha").setHardness(3F).setResistance(4F).setLightValue(2F); public void load() { hdblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/hdblock.png"); ModLoader.registerBlock(hdblock); ModLoader.addName(hdblock, "Hardened Diamond Block"); ModLoader.addRecipe(new ItemStack(hdblock, 1), new Object [] { "XXX", "X X", "XXX", Character.valueOf('X'), Item.diamond}); } public String getVersion() { return "1.2.5"; } }I knew i had it in the right place, It gets the texture, but not if i run it through eclipse.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumfor your last error: don't put the number your block ID is, just put blockID and put "mod_hdBlock",instead of mod_Block, that should help you somewhat
I've got most of the tool tutorial done, but I've been busy with work so I haven't been able to post it. Thanks though.
Have a look at the setRotationAngles method in ModelBiped.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI've been using your tutorials, and they've helped so much. They're great, thanks for making them.
I've run into a little problem, though. I am making, well updating, a mod of mine called Boss Mobs: Yeti. It adds Bosses to Minecraft, this particular part of the series adding the Yeti.
Well, everything was fine before, aside from some bugs, which is which this update was for. In the original, everything seemed to be spawning in the desert instead of the snow biomes I designated them to, and there were more than I had planned spawned in one area. So with this new version, I fixed that by copying some code from the Ghast so that it checks the biome and makes sure there is only one.
Now that everything is changed, I ran it from Eclipse and everything was perfect. As soon as I reob and try in actual Minecraft, though, nothing spawns at all, nor can I spawn it with SPC, even in proper snow biomes.
Here is the code that I use.
mod_Yeti
package net.minecraft.src; import java.util.Map; public class mod_Yeti extends BaseMod { public void load() { ModLoader.registerEntityID(EntityYeti.class, "Yeti", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(EntityYeti.class, 1, 1, 1, EnumCreatureType.creature); ModLoader.registerEntityID(EntityHunter.class, "Hunter", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(EntityHunter.class, 3, 3, 6, EnumCreatureType.creature); } public void addRenderer(Map map) { //Render and Model map.put(EntityYeti.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(EntityHunter.class, new RenderBiped(new ModelBiped(), 0.5F)); //Spawning ModLoader.addSpawn(EntityYeti.class, 2, 1, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.taiga, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.taigaHills }); ModLoader.addSpawn(EntityHunter.class, 2, 1, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.taiga, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.taigaHills }); } public String getVersion() { return "1.2.5"; } }EntityYeti
package net.minecraft.src; import java.util.Random; public class EntityYeti extends EntityMob { public EntityYeti(World world) { super(world); texture = "/yeti.png"; moveSpeed = 0.5F; targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityHunter.class, 16F, 0, true)); attackStrength = 10; //take this line out if this class doesn't extend EntityMob. } public int getMaxHealth() { return 25; } protected String getLivingSound() { return "mob.zombie"; } protected String getHurtSound() { return "mob.zombiehurt"; } protected String getDeathSound() { return "mob.zombiedeath"; } /** * Returns the item ID for the item the mob drops on death. */ protected int getDropItemId() { return Block.ice.blockID; } /** * Drop 0-2 items of this living's type */ protected void dropFewItems(boolean par1, int par2) { int i = rand.nextInt(3) + rand.nextInt(1 + par2); for (int j = 0; j < i; j++) { dropItem(Block.ice.blockID, 1); } i = rand.nextInt(3) + 1 + rand.nextInt(1 + par2); for (int k = 0; k < i; k++) { if (isBurning()) { dropItem(Item.diamond.shiftedIndex, 1); } else { dropItem(Item.snowball.shiftedIndex, 4); } } } protected boolean canDespawn() { return false; } /** * Checks if the entity's current position is a valid location to spawn this entity. */ public boolean getCanSpawnHere() { return rand.nextInt(20) == 0 && super.getCanSpawnHere() && worldObj.difficultySetting > 0; } /** * Will return how many at most can spawn in a chunk at once. */ public int getMaxSpawnedInChunk() { return 1; } }I also added a new mob to it, Hunters. They are supposed to attack the Yetis, and the Yetis are supposed to attack them. But they don't, not even in eclipse.
EntityHunter
package net.minecraft.src; import java.util.Random; public class EntityHunter extends EntityMob { public EntityHunter(World world) { super(world); texture = "/hunter.png"; moveSpeed = 0.5F; targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityYeti.class, 16F, 0, true)); attackStrength = 4; //take this line out if this class doesn't extend EntityMob. } public int getMaxHealth() { return 20; } protected String getLivingSound() { return "mob.villager.default"; } protected String getHurtSound() { return "mob.villager.defaulthurt"; } protected String getDeathSound() { return "mob.villager.defaultdeath"; } protected int getDropItemId() { return Item.ingotGold.shiftedIndex; } protected boolean canDespawn() { return false; } public ItemStack getHeldItem() { return defaultHeldItem; } static { defaultHeldItem = new ItemStack(Item.swordStone, 1); } private static final ItemStack defaultHeldItem; /** * Checks if the entity's current position is a valid location to spawn this entity. */ public boolean getCanSpawnHere() { return rand.nextInt(20) == 0 && super.getCanSpawnHere() && worldObj.difficultySetting > 0; } }Yes, this was directed to the creator of these tutorials, but if you know the problem and can respond before him (ASAP), please go ahead, this has been frustrating me for hours.
Thanks,
Jesuitical.
package net.minecraft.src; public class mod_ObsidianApple extends BaseMod { public static final Item obsidianapple = new ItemFood(124, 20, 60F, true).setItemName("Obsidian Apple"); public void load() { obsidianapple.iconIndex = ModLoader.addOverride("/gui/items.png", "/mcp/eclipse/Client/bin/obsidianapple.png"); ModLoader.addName(obsidianapple, "Obsidian Apple"); ModLoader.addRecipe(new ItemStack(obsidianapple, 1), new Object [] {"@@@", "@#@", "@@@", Character.valueOf('#'), Item.appleRed, Character.valueOf('@'), Block.obsidian}); } public String getVersion() { return "1.2.5"; } }