I am getting errors on my biome still. I have tried adding their ids behind them (shown in the tut), I have tried deleting (byte), I tried replacing the item name with its id, I have tried deleting the mod_MangMod part and just leaving the name of the blocks...nothing. http://i.imgur.com/3jaGP.png
how can i make it so a tool turns into a new item when only 1 use remains?
OnItemDestroyedbyUse doesn't work (at all), and OnUpdate for some reason can't reduce the itemstack amount (IE, i can make it drop the tool i want, but i can't make it consume the item).
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
if (itemstack.getItemDamage() == itemstack.getMaxDamage())
{
world.playSoundAtEntity(entity, "mob.blaze.breathe", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.1F));
entity.dropItem(mod_EXPower.DepletedPick.shiftedIndex, 1);
itemstack.setItemDamage(11);
itemstack.stackSize = 0;
}
return;
}
I'm working on a mod and everything is alright if I recompile my .class files.
But when I start the test client, Modloader gives these errors
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 10/06/12 16:50
Minecraft: Minecraft 1.2.5
OS: Windows Vista (x86) version 6.0
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 3470 version 2.1.7770 Release, ATI Technologies Inc.
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
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 86e400b8 ----------
mod_Godstone:
package net.minecraft.src;
public abstract class mod_Godstone extends BaseMod
{ public static final Block Godstone = new Godstone(160, 0).setBlockName("Godstone").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load(){
Godstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Godstone.png");
ModLoader.registerBlock(Godstone);
ModLoader.addName(Godstone, "Godstone");
ModLoader.addRecipe(new ItemStack(Godstone, 1), new Object [] { ('#'), Character.valueOf('#'), Block.stone});
}
public String getVersion()
{
return "1.2.5";
}
}
Godstone:
package net.minecraft.src;
import java.util.Random;
public class Godstone extends Block
{
public Godstone (int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Godstone.Godstone.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
If someone could help me I would greatly appreciate it!!
Did you save them as .class files? If so, that's wrong. They should be .java files.
but nothing is happening when i kill the mob other than it dying silently
please help me - id prefer to use than than to use AudioMod :/
Please tell me what i am doing wrong - thank you!!
It is impossible to read that code with all of those html tags. From what I can see though, you need to change the sound method to just return the String and not the method to play sounds.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
how can i make it so a tool turns into a new item when only 1 use remains?
OnItemDestroyedbyUse doesn't work (at all), and OnUpdate for some reason can't reduce the itemstack amount (IE, i can make it drop the tool i want, but i can't make it consume the item).
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
if (itemstack.getItemDamage() == itemstack.getMaxDamage())
{
world.playSoundAtEntity(entity, "mob.blaze.breathe", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.1F));
entity.dropItem(mod_EXPower.DepletedPick.shiftedIndex, 1);
itemstack.setItemDamage(11);
itemstack.stackSize = 0;
}
return;
}
Thanks TechGuy. It's nice to see some quality written tuts with templates, and an understanding that sensible people actually like to know what they are doing.
I'd been going nuts watching video tuts made by guys who just waved the mouse around and said "likeawesomedudecitywhatevermanyeahwellitshouldwork" and the very thing you want to know they don't know either.
Great work. Don't go rotten as you enter middle teen age.
how can i make it so a tool turns into a new item when only 1 use remains?
OnItemDestroyedbyUse doesn't work (at all), and OnUpdate for some reason can't reduce the itemstack amount (IE, i can make it drop the tool i want, but i can't make it consume the item).
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
if (itemstack.getItemDamage() == itemstack.getMaxDamage())
{
world.playSoundAtEntity(entity, "mob.blaze.breathe", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.1F));
entity.dropItem(mod_EXPower.DepletedPick.shiftedIndex, 1);
itemstack.setItemDamage(11);
itemstack.stackSize = 0;
}
return;
}
Your code looks like it should work but there is one thing that may be stopping it from doing so. Changing the if statement to this will most likely fix your issue.
if (itemstack.getItemDamage() == 1)
I think it is fairly easy to understand what I did but just ask if you're unsure.
Thanks TechGuy. It's nice to see some quality written tuts with templates, and an understanding that sensible people actually like to know what they are doing.
I'd been going nuts watching video tuts made by guys who just waved the mouse around and said "likeawesomedudecitywhatevermanyeahwellitshouldwork" and the very thing you want to know they don't know either.
Great work. Don't go rotten as you enter middle teen age.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
TechGuy, would you know how to open a gui with ModLoader?
I don't know how to use ModLoader.openGui but I do know that you can use:
mc.displayGuiScreen(new GuiNamehere(world, entityplayer/*and any other args*/);
Where mc is the Minecraft instance. I can only assume you use the ModLoader method the same way, but it does the same thing anyway.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Im making the tools for my mod and i cant figure out how to fix this error:
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_04\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Tools.java:4: error: cannot find symbol
public static final Item pickaxe = new ItemLeadPickaxe(2000, EnumToolMaterial.LE
AD).setItemName("pickaxe");
^
symbol: variable LEAD
location: class EnumToolMaterial
src\minecraft\net\minecraft\src\mod_Tools.java:5: error: cannot find symbol
public static final Item axe = new ItemLeadAxe(2001, EnumToolMaterial.LEAD).setI
temName("axe");
^
symbol: variable LEAD
location: class EnumToolMaterial
src\minecraft\net\minecraft\src\mod_Tools.java:6: error: cannot find symbol
public static final Item shovel = new ItemLeadShovel(2002, EnumToolMaterial.LEAD
).setItemName("shovel");
^
symbol: variable LEAD
location: class EnumToolMaterial
src\minecraft\net\minecraft\src\mod_Tools.java:7: error: cannot find symbol
public static final Item sword = new ItemLeadSword(2003, EnumToolMaterialLead.LE
AD).setItemName("sword");
^
symbol: variable LEAD
location: class EnumToolMaterialLead
src\minecraft\net\minecraft\src\mod_Tools.java:8: error: cannot find symbol
public static final Item hoe = new ItemLeadHoe(2004, EnumToolMaterialLead.LEAD).
setItemName("hoe");
^
symbol: variable LEAD
location: class EnumToolMaterialLead
5 errors
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
This is my coding:
package net.minecraft.src;
public class mod_Tools extends BaseMod
{
public static final Item pickaxe = new ItemLeadPickaxe(2000, EnumToolMaterial.LEAD).setItemName("pickaxe");
public static final Item axe = new ItemLeadAxe(2001, EnumToolMaterial.LEAD).setItemName("axe");
public static final Item shovel = new ItemLeadShovel(2002, EnumToolMaterial.LEAD).setItemName("shovel");
public static final Item sword = new ItemLeadSword(2003, EnumToolMaterialLead.LEAD).setItemName("sword");
public static final Item hoe = new ItemLeadHoe(2004, EnumToolMaterialLead.LEAD).setItemName("hoe");
public void load()
{
pickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadPickaxe.png");
axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadAxe.png");
shovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadShovel.png");
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadSword.png");
hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadHoe.png");
ModLoader.addName(pickaxe, "Lead Pickaxe");
ModLoader.addName(axe, "Lead Axe");
ModLoader.addName(shovel, "Lead Shovel");
ModLoader.addName(sword, "Lead Sword");
ModLoader.addName(hoe, "Lead Hoe");
ModLoader.addRecipe(new ItemStack(pickaxe, 1), new Object [] {
"###", " % ", " % ", '#', mod_tutorials.LeadIngot, '%', Item.stick
});
ModLoader.addRecipe(new ItemStack(axe, 1), new Object [] {
"##", "#%", " %", '#', mod_tutorials.LeadIngot, '%', Item.stick
});
ModLoader.addRecipe(new ItemStack(shovel, 1), new Object [] {
"#", "%", "%", '#', mod_tutorials.LeadIngot, '%', Item.stick
});
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {
"#", "#", "%", '#', mod_tutorials.LeadIngot, '%', Item.stick
});
ModLoader.addRecipe(new ItemStack(hoe, 1), new Object [] {
"##", " %", " %", '#', mod_tutorials.LeadIngot, '%', Item.stick
});
}
public String getVersion()
{
return "1.2.5";
}
}
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumalienbiome.java
package net.minecraft.src; import java.util.List; import java.util.Random; public class alienbiome extends BiomeGenBase { public alienbiome(int par1) { super(par1); spawnableCreatureList.clear(); topBlock = (byte)mod_MangMod.aliengrass; fillerBlock = (byte)mod_MangMod.aliendirt; biomeDecorator.treesPerChunk = 0; biomeDecorator.flowersPerChunk = 0; biomeDecorator.grassPerChunk = 0; } }OnItemDestroyedbyUse doesn't work (at all), and OnUpdate for some reason can't reduce the itemstack amount (IE, i can make it drop the tool i want, but i can't make it consume the item).
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { if (itemstack.getItemDamage() == itemstack.getMaxDamage()) { world.playSoundAtEntity(entity, "mob.blaze.breathe", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.1F)); entity.dropItem(mod_EXPower.DepletedPick.shiftedIndex, 1); itemstack.setItemDamage(11); itemstack.stackSize = 0; } return; }I have no idea.
And TechGuy, would you have any idea on how to make a new crafting thing with ModLoader?
Did you save them as .class files? If so, that's wrong. They should be .java files.
ModLoader.addRecipe(new ItemStack(Godstone, 1), new Object []{"#", Character.valueOf('#'), Block.stone})-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYour code would like like this:
/texture.png (if put into bin)
/modfolder/texture.png (if put into a folder)
mod File
package net.minecraft.src; import java.util.Random; import java.util.Map; public class mod_NotchandHerobrine extends BaseMod { public mod_NotchandHerobrine() { ModLoader.registerEntityID(EntityAngel.class, "Angel", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(EntityAngel.class, 15, 5, 7, EnumCreatureType.creature); } public void addRenderer(Map map) { map.put(EntityAngel.class, new RenderAngel(new ModelAngel(), 0.5F)); } public String getVersion() { return null; } @Override public void load() { } }Entity File
package net.minecraft.src; import java.util.Random; public class EntityAngel extends EntityMob { public EntityAngel(World world) { super(world); texture = "/image.png"; moveSpeed = 0.5F; isImmuneToFire = false; attackStrength = 4; //This line can only be here if the class extends EntityMob above ^^^. If it doesn't, just delete this whole line } public int getMaxHealth() { return 25; } protected String getLivingSound() { return "mob.ghast.affectionate scream"; } protected String getHurtSound() { return "mob.villager.defaulthurt"; } protected String getDeathSound() { return "mob.villager.defaultdeath"; } protected int getDropItemId() { return Item.ingotGold.shiftedIndex; } public ItemStack getHeldItem() { return defaultHeldItem; } static { defaultHeldItem = new ItemStack(Item.swordGold, 1); } private static final ItemStack defaultHeldItem; protected boolean canDespawn() { return true; } }I wouldn't include them if they weren't needed
It is impossible to read that code with all of those html tags. From what I can see though, you need to change the sound method to just return the String and not the method to play sounds.
protected String getDeathSound() { return "mob.spottedgrannymod.grannydead"; }Post your render code.
Not taking requests, I've done the third one anyway. The rest except the furnace are on the to-do list. Look before you post.
Windows Explorer or the Mac File Browser.
together they are powerful beyond imagination."
OnItemDestroyedbyUse doesn't work (at all), and OnUpdate for some reason can't reduce the itemstack amount (IE, i can make it drop the tool i want, but i can't make it consume the item).
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { if (itemstack.getItemDamage() == itemstack.getMaxDamage()) { world.playSoundAtEntity(entity, "mob.blaze.breathe", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.1F)); entity.dropItem(mod_EXPower.DepletedPick.shiftedIndex, 1); itemstack.setItemDamage(11); itemstack.stackSize = 0; } return; }I'd been going nuts watching video tuts made by guys who just waved the mouse around and said "likeawesomedudecitywhatevermanyeahwellitshouldwork" and the very thing you want to know they don't know either.
Great work. Don't go rotten as you enter middle teen age.
Your code looks like it should work but there is one thing that may be stopping it from doing so. Changing the if statement to this will most likely fix your issue.
I think it is fairly easy to understand what I did but just ask if you're unsure.
Thanks, I appreciate it
together they are powerful beyond imagination."
Pixels are always the same size
I don't know how to use ModLoader.openGui but I do know that you can use:
Where mc is the Minecraft instance. I can only assume you use the ModLoader method the same way, but it does the same thing anyway.
together they are powerful beyond imagination."
Example:
See how some of the pixels are messed up? How do i fix that?
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_04\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Tools.java:4: error: cannot find symbol
public static final Item pickaxe = new ItemLeadPickaxe(2000, EnumToolMaterial.LE
AD).setItemName("pickaxe");
^
symbol: variable LEAD
location: class EnumToolMaterial
src\minecraft\net\minecraft\src\mod_Tools.java:5: error: cannot find symbol
public static final Item axe = new ItemLeadAxe(2001, EnumToolMaterial.LEAD).setI
temName("axe");
^
symbol: variable LEAD
location: class EnumToolMaterial
src\minecraft\net\minecraft\src\mod_Tools.java:6: error: cannot find symbol
public static final Item shovel = new ItemLeadShovel(2002, EnumToolMaterial.LEAD
).setItemName("shovel");
^
symbol: variable LEAD
location: class EnumToolMaterial
src\minecraft\net\minecraft\src\mod_Tools.java:7: error: cannot find symbol
public static final Item sword = new ItemLeadSword(2003, EnumToolMaterialLead.LE
AD).setItemName("sword");
^
symbol: variable LEAD
location: class EnumToolMaterialLead
src\minecraft\net\minecraft\src\mod_Tools.java:8: error: cannot find symbol
public static final Item hoe = new ItemLeadHoe(2004, EnumToolMaterialLead.LEAD).
setItemName("hoe");
^
symbol: variable LEAD
location: class EnumToolMaterialLead
5 errors
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
This is my coding:
package net.minecraft.src; public class mod_Tools extends BaseMod { public static final Item pickaxe = new ItemLeadPickaxe(2000, EnumToolMaterial.LEAD).setItemName("pickaxe"); public static final Item axe = new ItemLeadAxe(2001, EnumToolMaterial.LEAD).setItemName("axe"); public static final Item shovel = new ItemLeadShovel(2002, EnumToolMaterial.LEAD).setItemName("shovel"); public static final Item sword = new ItemLeadSword(2003, EnumToolMaterialLead.LEAD).setItemName("sword"); public static final Item hoe = new ItemLeadHoe(2004, EnumToolMaterialLead.LEAD).setItemName("hoe"); public void load() { pickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadPickaxe.png"); axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadAxe.png"); shovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadShovel.png"); sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadSword.png"); hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/LeadHoe.png"); ModLoader.addName(pickaxe, "Lead Pickaxe"); ModLoader.addName(axe, "Lead Axe"); ModLoader.addName(shovel, "Lead Shovel"); ModLoader.addName(sword, "Lead Sword"); ModLoader.addName(hoe, "Lead Hoe"); ModLoader.addRecipe(new ItemStack(pickaxe, 1), new Object [] { "###", " % ", " % ", '#', mod_tutorials.LeadIngot, '%', Item.stick }); ModLoader.addRecipe(new ItemStack(axe, 1), new Object [] { "##", "#%", " %", '#', mod_tutorials.LeadIngot, '%', Item.stick }); ModLoader.addRecipe(new ItemStack(shovel, 1), new Object [] { "#", "%", "%", '#', mod_tutorials.LeadIngot, '%', Item.stick }); ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] { "#", "#", "%", '#', mod_tutorials.LeadIngot, '%', Item.stick }); ModLoader.addRecipe(new ItemStack(hoe, 1), new Object [] { "##", " %", " %", '#', mod_tutorials.LeadIngot, '%', Item.stick }); } public String getVersion() { return "1.2.5"; } }How can i fix this?