You dont have to use techne, it just helps making mobs much more simpler. This problem has happened to me before, I'm not really sure how I fixed it, I just played around with it.
/**
* Defines what float the third param in setRotationAngles of ModelBase is
*/
protected float handleRotationFloat(EntityLiving par1EntityLiving, float par2)
{
return getWingRotation((EntityGroosling)par1EntityLiving, par2);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
renderGroosling((EntityGroosling)par1Entity, par2, par4, par6, par8, par9);
}
}
And finally here is my ModelGroosling.java class:
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
public class ModelGroosling extends ModelBase
{
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer rightLeg;
public ModelRenderer leftLeg;
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer bill;
public ModelRenderer chin;
public ModelGroosling()
{
int i = 16;
head = new ModelRenderer(this, 0, 0);
head.addBox(-2F, -6F, -2F, 4, 6, 3, 0.0F);
head.setRotationPoint(0.0F, -1 + i, -4F);
bill = new ModelRenderer(this, 14, 0);
bill.addBox(-2F, -4F, -4F, 4, 2, 2, 0.0F);
bill.setRotationPoint(0.0F, -1 + i, -4F);
chin = new ModelRenderer(this, 14, 4);
chin.addBox(-1F, -2F, -3F, 2, 2, 2, 0.0F);
chin.setRotationPoint(0.0F, -1 + i, -4F);
body = new ModelRenderer(this, 0, 9);
body.addBox(-3F, -4F, -3F, 6, 8, 6, 0.0F);
body.setRotationPoint(0.0F, i, 0.0F);
rightLeg = new ModelRenderer(this, 26, 0);
rightLeg.addBox(-1F, 0.0F, -3F, 3, 5, 3);
rightLeg.setRotationPoint(-2F, 3 + i, 1.0F);
leftLeg = new ModelRenderer(this, 26, 0);
leftLeg.addBox(-1F, 0.0F, -3F, 3, 5, 3);
leftLeg.setRotationPoint(1.0F, 3 + i, 1.0F);
rightWing = new ModelRenderer(this, 24, 13);
rightWing.addBox(0.0F, 0.0F, -3F, 1, 4, 6);
rightWing.setRotationPoint(-4F, -3 + i, 0.0F);
leftWing = new ModelRenderer(this, 24, 13);
leftWing.addBox(-1F, 0.0F, -3F, 1, 4, 6);
leftWing.setRotationPoint(4F, -3 + i, 0.0F);
}
Hey! I love your tutorials, they acually help. But I'm having a few problems...
iconIndex cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 10 Java Problem
maxStackSize cannot be resolved to a variable ItemWoodenDagger.java /Client/src/net/minecraft/src line 8 Java Problem
Oh and about the item.stick, when it says
stick cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 12 Java Problem
how do you find where all the item names are? Item.java? Because that only tells me stick...
Here's mod_Weapons:
package.net.minecraft.src;
public class mod_Weapons extends BaseMod
{
public static final Item WoodenDagger = new ItemWoodenDagger(5000).setItemName("Wooden Dagger");
public void load()
{
ModLoader.addName(WoodenDagger, "Wooden Dagger");
WoodenDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/WoodenDagger.png");
ModLoader.addRecipe(new ItemStack(WoodenDagger, 1), new Object [] {" ", " X ", " I ",
Character.valueOf('X'), Block.wood, Character.valueOf('I'), Item.stick});
}
public String getVersion()
{
return "More Everything Mod - Weapons - 1.2.5";
}
}
ItemWoodenDagger.java:
package net.minecraft.src;
public class ItemWoodenDagger extends Item
{
public ItemWoodenDagger(int i)
{
super(i);
maxStackSize = 1;
}
}
Hey! I love your tutorials, they acually help. But I'm having a few problems...
iconIndex cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 10 Java Problem
maxStackSize cannot be resolved to a variable ItemWoodenDagger.java /Client/src/net/minecraft/src line 8 Java Problem
Oh and about the item.stick, when it says
stick cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 12 Java Problem
how do you find where all the item names are? Item.java? Because that only tells me stick...
Here's mod_Weapons:
package.net.minecraft.src;
public class mod_Weapons extends BaseMod
{
public static final Item WoodenDagger = new ItemWoodenDagger(5000).setItemName("Wooden Dagger");
public void load()
{
ModLoader.addName(WoodenDagger, "Wooden Dagger");
WoodenDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/WoodenDagger.png");
ModLoader.addRecipe(new ItemStack(WoodenDagger, 1), new Object [] {" ", " X ", " I ",
Character.valueOf('X'), Block.wood, Character.valueOf('I'), Item.stick});
}
public String getVersion()
{
return "More Everything Mod - Weapons - 1.2.5";
}
}
ItemWoodenDagger.java:
package net.minecraft.src;
public class ItemWoodenDagger extends Item
{
public ItemWoodenDagger(int i)
{
super(i);
maxStackSize = 1;
}
}
Not really sure what the problem is off the top of my head, but: set you ID down (to about 200) and if you want to find out what items are in the code just look at a file called Item.java and look for "pubic static final" lines, the name after that is what the item is in code
Not really sure what the problem is off the top of my head, but: set you ID down (to about 200) and if you want to find out what items are in the code just look at a file called Item.java and look for "pubic static final" lines, the name after that is what the item is in code
Well, in Item.Java I couldn't find any "public static final" lines, only public static Item lines, like this one for stick:
public static Item field_266_B = (new Item(24)).func_20010_a(5, 3).func_4016_e().func_20011_a("stick");
And it's still saying those other errors
Well, in Item.Java I couldn't find any "public static final" lines, only public static Item lines, like this one for stick:
public static Item field_266_B = (new Item(24)).func_20010_a(5, 3).func_4016_e().func_20011_a("stick");
And it's still saying those other errors
Oh, yeah, public static Item, but whatever, that is what it is in code, and you can use the same method for any other item and/or block, and as to your errors: I would double check with techguys tutorials, if that doesn't work, then you probably have the wrong version of something
The Meaning of Life, the Universe, and Everything.
Join Date:
4/13/2012
Posts:
55
Minecraft:
DXPower
Member Details
For the Crafting and Smelting, where do I put the class? I am wanting to make a mod that allows you to make ores, by surrounding the material made/dropped by the ore surrounded by stone, making the ore. EX: Surround redstone with stone, you get redstone ore. Surround coal with stone, you get coal ore.
For the Crafting and Smelting, where do I put the class? I am wanting to make a mod that allows you to make ores, by surrounding the material made/dropped by the ore surrounded by stone, making the ore. EX: Surround redstone with stone, you get redstone ore. Surround coal with stone, you get coal ore.
could you define that? Have you made a mod before? Sorry, but this has several different things it could mean. If you are wondering were you put the mod_ file then you just go into mcp, to src (were all the other files are) and make a new file there, and put the stuff from the tutorial into it.
Oh, yeah, public static Item, but whatever, that is what it is in code, and you can use the same method for any other item and/or block, and as to your errors: I would double check with techguys tutorials, if that doesn't work, then you probably have the wrong version of something
I've got updated everything, just updated them and it's still messing up... any other ideas? D:
You could try re-writing all of your classes, I have gotten things to work doing that.
Alright, just did and I'm back at the few errors again. I even used the same recipe, the dirt one, and it's saying that THAT "cannot be resolved or is not a field", and that maxStackSize cannot be resolved to a variable. Why does it let me use "ModLoader.addName" but not "ModLoader.iconIndex" and maxStackSize? D:
JIC I messed up again, here's the code if anyone can solve this :/
Mod_Weapons:
package net.minecraft.src;
public class mod_Weapons extends BaseMod
{
public static final Item WoodenDagger = new ItemWoodenDagger(200).setItemName("WoodenDagger");
public void load()
{
WoodenDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/WoodenDagger");
ModLoader.addName(WoodenDagger, "Wooden Dagger");
ModLoader.addRecipe(new ItemStack(WoodenDagger, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getversion()
{
return "Not Enough Anything - Weapons";
}
}
}
ItemWoodenDagger.java:
package net.minecraft.src;
public class ItemWoodenDagger extends Item
{
public ItemWoodenDagger(int i)
{
super(i);
maxStackSize = 1;
}
}
For some reason, this doesnt work. This isnt the exact way you use, i usually use this for my mods.
( Adding 2 stairs and 2 blocks )
package net.minecraft.src;
import java.util.Random;
public class mod_Morestructures extends BaseMod {
public static final Block BlockCrumblingStone = new BlockCrumblingStone(2345);
public static final Block BlockRottingWood = new BlockRottingWood(2346);
public static final Block BlockRottingWoodStair = new BlockRottingWoodStairs(2348).setBlockName("BlockRottingWoodStairs").setHardness(3F).setResistance(4F);;
public static final Block BlockCrumblingStoneStair = new BlockCrumblingStoneStairs(2349).setBlockName("BlockCrumblingStoneStairs").setHardness(3F).setResistance(4F);;
public void load() {
ModLoader.addName(BlockCrumblingStone, "Crumbling Stone");
ModLoader.addName(BlockRottingWood, "Rotting Wood");
ModLoader.addName(BlockRottingWoodStair, "Rotting Wood Stair");
ModLoader.addName(BlockCrumblingStoneStair, "Crumbling Stone Stair");
ModLoader.addRecipe(new ItemStack(mod_Morestructures.BlockRottingWoodStair, 4), new Object[] {"0 ", "34 ", "678", Character.valueOf('0'), mod_Morestructures.BlockRottingWood, Character.valueOf('3'), mod_Morestructures.BlockRottingWood, Character.valueOf('4'), mod_Morestructures.BlockRottingWood, Character.valueOf('6'), mod_Morestructures.BlockRottingWood, Character.valueOf('7'), mod_Morestructures.BlockRottingWood, Character.valueOf('8'), mod_Morestructures.BlockRottingWood});
ModLoader.addRecipe(new ItemStack(mod_Morestructures.BlockCrumblingStoneStair, 4), new Object[] {"0 ", "34 ", "678", Character.valueOf('0'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('3'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('4'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('6'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('7'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('8'), mod_Morestructures.BlockCrumblingStone});
}
public void GenerateSurface(World world, Random random, int i, int j) {
}private void addSmelting(Block block, ItemStack is) {
ModLoader.addSmelting(block.blockID, is); }
private void addSmelting(Item item, ItemStack is) {
ModLoader.addSmelting(item.shiftedIndex, is); }
private ItemStack getIS(Item item, int amount) {
return new ItemStack(item, amount); }
private ItemStack getIS(Block block, int amount) {
return new ItemStack(block, amount); }
}
public String getVersion() {
return "1.2.5";}
First off, you didn't register your blocks. Use the ModLoader.registerBlock method. Second, please post your error report, so we can see what exactly does not work.
For the Crafting and Smelting, where do I put the class? I am wanting to make a mod that allows you to make ores, by surrounding the material made/dropped by the ore surrounded by stone, making the ore. EX: Surround redstone with stone, you get redstone ore. Surround coal with stone, you get coal ore.
A class is a file, such as your mod file, block file, or item file. addCrafting and addSmelting are methods, which are contained within the load method of your mod file.
Not really sure what the problem is off the top of my head, but: set you ID down (to about 200) and if you want to find out what items are in the code just look at a file called Item.java and look for "pubic static final" lines, the name after that is what the item is in code
For Items, the ID can go up to over 10000, so that is not an issue.
Hey! I love your tutorials, they acually help. But I'm having a few problems...
iconIndex cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 10 Java Problem
maxStackSize cannot be resolved to a variable ItemWoodenDagger.java /Client/src/net/minecraft/src line 8 Java Problem
Oh and about the item.stick, when it says
stick cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 12 Java Problem
how do you find where all the item names are? Item.java? Because that only tells me stick...
Here's mod_Weapons:
package.net.minecraft.src;
public class mod_Weapons extends BaseMod
{
public static final Item WoodenDagger = new ItemWoodenDagger(5000).setItemName("Wooden Dagger");
public void load()
{
ModLoader.addName(WoodenDagger, "Wooden Dagger");
WoodenDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/WoodenDagger.png");
ModLoader.addRecipe(new ItemStack(WoodenDagger, 1), new Object [] {" ", " X ", " I ",
Character.valueOf('X'), Block.wood, Character.valueOf('I'), Item.stick});
}
public String getVersion()
{
return "More Everything Mod - Weapons - 1.2.5";
}
}
ItemWoodenDagger.java:
package net.minecraft.src;
public class ItemWoodenDagger extends Item
{
public ItemWoodenDagger(int i)
{
super(i);
maxStackSize = 1;
}
}
You need to find a tutorial on how to make new tools, not just new items. I assume you want the dagger to function similarly to a sword?
A class is a file, such as your mod file, block file, or item file. addCrafting and addSmelting are methods, which are contained within the load method of your mod file.
For Items, the ID can go up to over 10000, so that is not an issue.
You need to find a tutorial on how to make new tools, not just new items. I assume you want the dagger to function similarly to a sword?
Oh, yeah, I guess. I looked for one and I can't find any besides youtube videos, and I hate learning by that... got any tutorials? and is that item problem going to keep happening, do you know? Thanks
I'm back and I need some help. I have made a minor mod with just a recipe and another mod with a santa mob but none of them are loading. I use MC patcher to install my mods but none of them seem to work. Any help would be great
Edit: Here are the two mods I have loaded and their files.
Secret Extras Mod
mod_SecretExtras.java
package net.minecraft.src;
import java.util.Map;
public class mod_SecretExtra extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(EntitySanta.class, "Santa", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntitySanta.class, 2, 1, 4, EnumCreatureType.creature, new BiomeGenBase[]
{
BiomeGenBase.taiga,
BiomeGenBase.jungle,
BiomeGenBase.jungleHills,
BiomeGenBase.hell
});
}
public void addRenderer(Map map)
{
map.put(EntitySanta.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
Oh, yeah, I guess. I looked for one and I can't find any besides youtube videos, and I hate learning by that... got any tutorials? and is that item problem going to keep happening, do you know? Thanks
Look around in the client SRC files. I had a look and I found this in the Item.java file:
swordDiamond = (new ItemSword(20, EnumToolMaterial.EMERALD)).setIconCoord(3, 4).setItemName("swordDiamond");
Just like a normal item, it would go in the "public void load()". I haven't tried this but it can't be too hard to figure it out
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Did you include this in your mod_ witchShakMod or mod_Witch?
public void addRenderer(Map map) { map.put(EntityNamehere.class, new RenderWitch(new ModelWitch(), 0.5F)); }Without it it would render your mob, also I recommend you only use one mod_modnamehere file, it makes it much more simpler.
I included it in mod_Witch
and btw, i didnt use techne. should i use it?
and okay i will try that thanks!
You dont have to use techne, it just helps making mobs much more simpler. This problem has happened to me before, I'm not really sure how I fixed it, I just played around with it.
mod_grooslingMob:
package net.minecraft.src;
import java.util.Map;
public class mod_grooslingMob extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(EntityGroosling.class, "Groosling", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityGroosling.class, 30, 30, 40, EnumCreatureType.creature);
}
public void addRenderer(Map map)
{
map.put(EntityGroosling.class, new RenderGroosling(new ModelGroosling(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
Here is the EntityGroosling.java class:
package net.minecraft.src;
import java.util.Random;
public class EntityGroosling extends EntityMob
{
public float destPos;
public EntityGroosling(World world)
{
super(world);
texture = "/groosling.png";
moveSpeed = 0.5F;
isImmuneToFire = false;
}
public int getMaxHealth()
{
return 2;
}
protected String getLivingSound()
{
return "mob.chicken.default";
}
protected String getHurtSound()
{
return "mob.chicken.defaulthurt";
}
protected String getDeathSound()
{
return "mob.chicken.defaultdeath";
}
protected int getDropItemId()
{
return mod_hungerGamesFoodNWeapons.rawgroosling.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
}
Here is my RenderGroosling.java class:
package net.minecraft.src;
public class RenderGroosling extends RenderLiving
{
public RenderGroosling(ModelBase par1ModelBase, float par2)
{
super(par1ModelBase, par2);
}
public void renderGroosling(EntityGroosling par1EntityGroosling, double par2, double par4, double par6, float par8, float par9)
{
super.doRenderLiving(par1EntityGroosling, par2, par4, par6, par8, par9);
}
protected float getWingRotation(EntityGroosling par1EntityGroosling, float par2)
{
float f = par1EntityGroosling.field_9348_ae + (par1EntityGroosling.field_9349_D - par1EntityGroosling.field_9348_ae) * par2;
float f1 = par1EntityGroosling.field_9349_D + (par1EntityGroosling.destPos - par1EntityGroosling.field_9349_D) * par2;
return (MathHelper.sin(f) + 1.0F) * f1;
}
/**
* Defines what float the third param in setRotationAngles of ModelBase is
*/
protected float handleRotationFloat(EntityLiving par1EntityLiving, float par2)
{
return getWingRotation((EntityGroosling)par1EntityLiving, par2);
}
public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
{
renderGroosling((EntityGroosling)par1EntityLiving, par2, par4, par6, par8, par9);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
renderGroosling((EntityGroosling)par1Entity, par2, par4, par6, par8, par9);
}
}
And finally here is my ModelGroosling.java class:
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
public class ModelGroosling extends ModelBase
{
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer rightLeg;
public ModelRenderer leftLeg;
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer bill;
public ModelRenderer chin;
public ModelGroosling()
{
int i = 16;
head = new ModelRenderer(this, 0, 0);
head.addBox(-2F, -6F, -2F, 4, 6, 3, 0.0F);
head.setRotationPoint(0.0F, -1 + i, -4F);
bill = new ModelRenderer(this, 14, 0);
bill.addBox(-2F, -4F, -4F, 4, 2, 2, 0.0F);
bill.setRotationPoint(0.0F, -1 + i, -4F);
chin = new ModelRenderer(this, 14, 4);
chin.addBox(-1F, -2F, -3F, 2, 2, 2, 0.0F);
chin.setRotationPoint(0.0F, -1 + i, -4F);
body = new ModelRenderer(this, 0, 9);
body.addBox(-3F, -4F, -3F, 6, 8, 6, 0.0F);
body.setRotationPoint(0.0F, i, 0.0F);
rightLeg = new ModelRenderer(this, 26, 0);
rightLeg.addBox(-1F, 0.0F, -3F, 3, 5, 3);
rightLeg.setRotationPoint(-2F, 3 + i, 1.0F);
leftLeg = new ModelRenderer(this, 26, 0);
leftLeg.addBox(-1F, 0.0F, -3F, 3, 5, 3);
leftLeg.setRotationPoint(1.0F, 3 + i, 1.0F);
rightWing = new ModelRenderer(this, 24, 13);
rightWing.addBox(0.0F, 0.0F, -3F, 1, 4, 6);
rightWing.setRotationPoint(-4F, -3 + i, 0.0F);
leftWing = new ModelRenderer(this, 24, 13);
leftWing.addBox(-1F, 0.0F, -3F, 1, 4, 6);
leftWing.setRotationPoint(4F, -3 + i, 0.0F);
}
/**
* Sets the models various rotation angles.
*/
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)
{
head.rotateAngleX = -(par5 / (180F / (float)Math.PI));
head.rotateAngleY = par4 / (180F / (float)Math.PI);
bill.rotateAngleX = head.rotateAngleX;
bill.rotateAngleY = head.rotateAngleY;
chin.rotateAngleX = head.rotateAngleX;
chin.rotateAngleY = head.rotateAngleY;
body.rotateAngleX = ((float)Math.PI / 2F);
rightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
leftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
rightWing.rotateAngleZ = par3;
leftWing.rotateAngleZ = -par3;
}
}
Yes they spawn, but they are invisible for some reason.
iconIndex cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 10 Java Problem
maxStackSize cannot be resolved to a variable ItemWoodenDagger.java /Client/src/net/minecraft/src line 8 Java Problem
Oh and about the item.stick, when it says
stick cannot be resolved or is not a field mod_Weapons.java /Client/src/net/minecraft/src line 12 Java Problem
how do you find where all the item names are? Item.java? Because that only tells me stick...
Here's mod_Weapons:
package.net.minecraft.src; public class mod_Weapons extends BaseMod { public static final Item WoodenDagger = new ItemWoodenDagger(5000).setItemName("Wooden Dagger"); public void load() { ModLoader.addName(WoodenDagger, "Wooden Dagger"); WoodenDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/WoodenDagger.png"); ModLoader.addRecipe(new ItemStack(WoodenDagger, 1), new Object [] {" ", " X ", " I ", Character.valueOf('X'), Block.wood, Character.valueOf('I'), Item.stick}); } public String getVersion() { return "More Everything Mod - Weapons - 1.2.5"; } }ItemWoodenDagger.java:
package net.minecraft.src; public class ItemWoodenDagger extends Item { public ItemWoodenDagger(int i) { super(i); maxStackSize = 1; } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNot really sure what the problem is off the top of my head, but: set you ID down (to about 200) and if you want to find out what items are in the code just look at a file called Item.java and look for "pubic static final" lines, the name after that is what the item is in code
Well, in Item.Java I couldn't find any "public static final" lines, only public static Item lines, like this one for stick:
public static Item field_266_B = (new Item(24)).func_20010_a(5, 3).func_4016_e().func_20011_a("stick");
And it's still saying those other errors
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOh, yeah, public static Item, but whatever, that is what it is in code, and you can use the same method for any other item and/or block, and as to your errors: I would double check with techguys tutorials, if that doesn't work, then you probably have the wrong version of something
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumcould you define that? Have you made a mod before? Sorry, but this has several different things it could mean. If you are wondering were you put the mod_ file then you just go into mcp, to src (were all the other files are) and make a new file there, and put the stuff from the tutorial into it.
I've got updated everything, just updated them and it's still messing up... any other ideas? D:
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou could try re-writing all of your classes, I have gotten things to work doing that.
Alright, just did and I'm back at the few errors again. I even used the same recipe, the dirt one, and it's saying that THAT "cannot be resolved or is not a field", and that maxStackSize cannot be resolved to a variable. Why does it let me use "ModLoader.addName" but not "ModLoader.iconIndex" and maxStackSize? D:
JIC I messed up again, here's the code if anyone can solve this :/
Mod_Weapons:
package net.minecraft.src; public class mod_Weapons extends BaseMod { public static final Item WoodenDagger = new ItemWoodenDagger(200).setItemName("WoodenDagger"); public void load() { WoodenDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/WoodenDagger"); ModLoader.addName(WoodenDagger, "Wooden Dagger"); ModLoader.addRecipe(new ItemStack(WoodenDagger, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); } public String getversion() { return "Not Enough Anything - Weapons"; } } }ItemWoodenDagger.java:
package net.minecraft.src; public class ItemWoodenDagger extends Item { public ItemWoodenDagger(int i) { super(i); maxStackSize = 1; } }-
View User Profile
-
View Posts
-
Send Message
Retired Staff( Adding 2 stairs and 2 blocks )
package net.minecraft.src; import java.util.Random; public class mod_Morestructures extends BaseMod { public static final Block BlockCrumblingStone = new BlockCrumblingStone(2345); public static final Block BlockRottingWood = new BlockRottingWood(2346); public static final Block BlockRottingWoodStair = new BlockRottingWoodStairs(2348).setBlockName("BlockRottingWoodStairs").setHardness(3F).setResistance(4F);; public static final Block BlockCrumblingStoneStair = new BlockCrumblingStoneStairs(2349).setBlockName("BlockCrumblingStoneStairs").setHardness(3F).setResistance(4F);; public void load() { ModLoader.addName(BlockCrumblingStone, "Crumbling Stone"); ModLoader.addName(BlockRottingWood, "Rotting Wood"); ModLoader.addName(BlockRottingWoodStair, "Rotting Wood Stair"); ModLoader.addName(BlockCrumblingStoneStair, "Crumbling Stone Stair"); ModLoader.addRecipe(new ItemStack(mod_Morestructures.BlockRottingWoodStair, 4), new Object[] {"0 ", "34 ", "678", Character.valueOf('0'), mod_Morestructures.BlockRottingWood, Character.valueOf('3'), mod_Morestructures.BlockRottingWood, Character.valueOf('4'), mod_Morestructures.BlockRottingWood, Character.valueOf('6'), mod_Morestructures.BlockRottingWood, Character.valueOf('7'), mod_Morestructures.BlockRottingWood, Character.valueOf('8'), mod_Morestructures.BlockRottingWood}); ModLoader.addRecipe(new ItemStack(mod_Morestructures.BlockCrumblingStoneStair, 4), new Object[] {"0 ", "34 ", "678", Character.valueOf('0'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('3'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('4'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('6'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('7'), mod_Morestructures.BlockCrumblingStone, Character.valueOf('8'), mod_Morestructures.BlockCrumblingStone}); } public void GenerateSurface(World world, Random random, int i, int j) { }private void addSmelting(Block block, ItemStack is) { ModLoader.addSmelting(block.blockID, is); } private void addSmelting(Item item, ItemStack is) { ModLoader.addSmelting(item.shiftedIndex, is); } private ItemStack getIS(Item item, int amount) { return new ItemStack(item, amount); } private ItemStack getIS(Block block, int amount) { return new ItemStack(block, amount); } } public String getVersion() { return "1.2.5";}First off, you didn't register your blocks. Use the ModLoader.registerBlock method. Second, please post your error report, so we can see what exactly does not work.
A class is a file, such as your mod file, block file, or item file. addCrafting and addSmelting are methods, which are contained within the load method of your mod file.
For Items, the ID can go up to over 10000, so that is not an issue.
You need to find a tutorial on how to make new tools, not just new items. I assume you want the dagger to function similarly to a sword?
Oh, yeah, I guess. I looked for one and I can't find any besides youtube videos, and I hate learning by that... got any tutorials? and is that item problem going to keep happening, do you know? Thanks
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumEdit: Here are the two mods I have loaded and their files.
Secret Extras Mod
package net.minecraft.src; import java.util.Map; public class mod_SecretExtra extends BaseMod { public void load() { ModLoader.registerEntityID(EntitySanta.class, "Santa", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(EntitySanta.class, 2, 1, 4, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.taiga, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.hell }); } public void addRenderer(Map map) { map.put(EntitySanta.class, new RenderBiped(new ModelBiped(), 0.5F)); } public String getVersion() { return "1.2.5"; } }EntitySanta.java
package net.minecraft.src; import java.util.Random; public class EntitySanta extends EntityCreature { public EntitySanta(World world) { super(world); texture = "/mob/Santa.png"; moveSpeed = 0.5F; } 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() { int GiftNum = rand.nextInt(20); int Gift = 0; if(GiftNum==0) {Gift = Item.compass.shiftedIndex;} if(GiftNum==1||GiftNum==2) {Gift = Item.ingotIron.shiftedIndex;} if(GiftNum==3||GiftNum==4||GiftNum==5||GiftNum==6||GiftNum==7||GiftNum==8) {Gift = Item.appleRed.shiftedIndex;} if(GiftNum==9||GiftNum==10) {Gift = Item.ingotGold.shiftedIndex;} if(GiftNum==11) {Gift = Item.appleGold.shiftedIndex;} if(GiftNum==12||GiftNum==13||GiftNum==14) {Gift = Block.planks.blockID;} if(GiftNum==15) {Gift = Item.saddle.shiftedIndex;} if(GiftNum==16||GiftNum==17) {Gift = Item.bucketEmpty.shiftedIndex;} if(GiftNum==19||GiftNum==10) {Gift = Item.redstone.shiftedIndex;} return Gift; } protected boolean canDespawn() { return false; } }Minor Extras Mod
package net.minecraft.src; public class mod_MinorExtras extends BaseMod { public static final Item NetherDust = new ItemNetherDust(812).setItemName("NetherDust").setIconCoord(8, 3).setFull3D(); public void load() { ModLoader.addName(NetherDust, "Nether Dust"); ModLoader.addRecipe(new ItemStack(NetherDust, 10), new Object [] {"N ", "GS", Character.valueOf('N'), Block.netherrack, Character.valueOf('G'), Item.gunpowder, Character.valueOf('S'), Item.sugar}); ModLoader.addRecipe(new ItemStack(Block.stoneBrick, 4, 3), new Object [] {"BB", "BB", Character.valueOf('B'), new ItemStack(Block.stoneBrick, 1, 0)}); ModLoader.addRecipe(new ItemStack(Block.web, 1), new Object [] {"S S", " S ", "S S", Character.valueOf('S'), Item.silk}); } public String getVersion() { return "1.2.5"; } }ItemNetherDust.java
package net.minecraft.src; import java.util.Random; public class ItemNetherDust extends Item { public ItemNetherDust(int par1) { super(par1); maxStackSize = 64; setMaxDamage(1); } public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) { if (par7 == 0) { par5--; } if (par7 == 1) { par5++; } if (par7 == 2) { par6--; } if (par7 == 3) { par6++; } if (par7 == 4) { par4--; } if (par7 == 5) { par4++; } if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6)) { return false; } int i = par3World.getBlockId(par4, par5, par6); if (i == 0) { par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); par3World.setBlockWithNotify(par4, par5, par6, Block.fire.blockID); } par1ItemStack.damageItem(2, par2EntityPlayer); return true; } }I've also ran the startclient.bat file and the mod loads fine but when I compile it and load it with MCPathcer, I get nothing :\
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumLook around in the client SRC files. I had a look and I found this in the Item.java file:
swordDiamond = (new ItemSword(20, EnumToolMaterial.EMERALD)).setIconCoord(3, 4).setItemName("swordDiamond");Just like a normal item, it would go in the "public void load()". I haven't tried this but it can't be too hard to figure it out