Tutorials will be updated when they're updated. Don't ask about them. That is really strange because it is asking for no arguments where your id and texture index are. I would suggest backing up your source, downloading Minecraft jars, MCP and ModLoader again and setting it up again.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Is there now a solution to fix entities?
I quess it was a problem with EntityTracker.
Sry if this question isn't related to your tutorial, I just saw you didn't updated your NPC and Mob tutorials, so maybe you could have a clue how to fix it anyway.
It isn't a problem with EntityTracker. It is a problem with us not being able to add our own entities to it without editing it. No mods will be compatible if we all edit it. We are presented with a problem, that hopefully Risugami can solve by giving us a ModLoader method. Not saying we should all just give up and leave the work to Risugami, because we shouldn't. We can however remain hopeful he will give us a great hand like he already has done so much.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Who Does anyone have a code of Ore Generation for minecraft 1.3.1 if yes send it to me
sorry for my English because I use Google translator because I am from Russia
Apparently ModLoader has updated and fixed generation. I am testing now and will let you know.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thx for your reply, I'm hoping Risugami knows about this (did anyone contact him?) and gonna add this feature soon (a cooperation with ModloaderMP would be nice)
I'm sure he would have received several hundred messages regarding it I'm testing it now because ModLoader updated(you probably saw I mentioned that in my giant heading above though). Hopefully Risugami fixed entity registering as well as the generation.
EDIT: No, hasn't been fixed. We'll have to keep trying to fix it ourselves, I guess.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Did you set the workspace to the eclipse folder in MCP?
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 don't have the same issue nor can I reproduce it. I don't know the problem.
I and my friend are having the same problem.
please check it out. I am not the only one.
BlockDirtcrop
package net.minecraft.src;
import java.util.Random;
public class BlockDirtcrop extends BlockFlower
{
public BlockDirtcrop(int i, int j)
{
super(i, j);
blockIndexInTexture = j;
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID.
* This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow.
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class.
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i < 8)
{
float f = getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25F / f) + 1) == 0)
{
i++;
par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
}
}
}
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float f = 1.0F;
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean flag = k == blockID || l == blockID;
boolean flag1 = i == blockID || j == blockID;
boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID;
for (int i2 = par2 - 1; i2 <= par2 + 1; i2++)
{
for (int j2 = par4 - 1; j2 <= par4 + 1; j2++)
{
int k2 = par1World.getBlockId(i2, par3 - 1, j2);
float f1 = 0.0F;
if (k2 == Block.tilledField.blockID)
{
f1 = 1.0F;
if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0)
{
f1 = 3F;
}
}
if (i2 != par2 || j2 != par4)
{
f1 /= 4F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
/**
* The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom.
*/
public int getRenderType()
{
return 6;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
if (par1World.isRemote)
{
return;
}
int i = 3 + par7;
for (int j = 0; j < i; j++)
{
if (par1World.rand.nextInt(15) <= par5)
{
float f = 0.7F;
float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_dirtcrop.dirtseed));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
}
/**
* Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below). This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is not equal to 7 then drop nothing (-1 means nothing)
*/
public int idDropped(int i, Random random, int j)
{
int n = random.nextInt(2);
if (i == 8)
{
if ( n == 1)
{
return mod_dirtcrop2.dirtseed2.shiftedIndex;
}
else
{
return mod_Sean.hd1.blockID;
}
}
else
{
return -1;
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random random)
{
return 1;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata.
* As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined.
* The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth.
*/
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return mod_dirtcrop.cropStageOne;
}
if(j == 1)
{
return mod_dirtcrop.cropStageOne;
}
if(j == 2)
{
return mod_dirtcrop.cropStageTwo;
}
if(j == 3)
{
return mod_dirtcrop.cropStageThree;
}
if(j == 4)
{
return mod_dirtcrop.cropStageFour;
}
if(j == 5)
{
return mod_dirtcrop.cropStageFive;
}
if(j == 6)
{
return mod_dirtcrop.cropStageSix;
}
if(j == 7)
{
return mod_dirtcrop.cropStageSeven;
}
if(j == 8)
{
return mod_dirtcrop.cropStageEight;
}
return j;
}
}
mod_dirtcrop
package net.minecraft.src;
public class mod_dirtcrop extends BaseMod
{
//Just a standard block.
public static final Block dirtcrop = new BlockDirtcrop(220, 0).setBlockName("dirtcrop");
//This is a fairly standard item but it has two new arguments. The first is the block it plants, in this case is our new crop "cropNameHere". The second is the block that is required to be right clicked on to plant the seeds.
//We are using tilled field/dirt for this crop but you can change it to whatever you like. Remember to change it in the block class as well.
public static final Item dirtseed = new ItemDirtseed(2500, dirtcrop.blockID, Block.tilledField.blockID).setItemName("dirtseed");
//These static ints are the textures of the crop in its various stages of growth.
public static int cropStageOne = ModLoader.addOverride("/terrain.png", "crop1.png");
public static int cropStageTwo = ModLoader.addOverride("/terrain.png", "crop2.png");
public static int cropStageThree = ModLoader.addOverride("/terrain.png", "crop3.png");
public static int cropStageFour = ModLoader.addOverride("/terrain.png", "crop4.png");
public static int cropStageFive = ModLoader.addOverride("/terrain.png", "crop5.png");
public static int cropStageSix = ModLoader.addOverride("/terrain.png", "crop6.png");
public static int cropStageSeven = ModLoader.addOverride("/terrain.png", "crop7.png");
public static int cropStageEight = ModLoader.addOverride("/terrain.png", "crop8.png");
public void load()
{
dirtcrop.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "crop.png");
ModLoader.registerBlock(dirtcrop);
ModLoader.addName(dirtcrop, "Nutrition Absorption");
dirtseed.iconIndex = ModLoader.addOverride("/gui/items.png", "seed.png");
ModLoader.addName(dirtseed, "Absorption Seeds");
ModLoader.addRecipe(new ItemStack(dirtseed), new Object [] {
"N", "S",
'N', mod_Sean.SeanFood,
'S', Item.seeds
});
}
public String getVersion()
{
return "1.3.1";
}
}
all my tools are normal items, but works normal like an pickaxe or so.
In the code is no error and when i start the game theres no error too.
package net.minecraft.src;
public class ItemCoSword extends Item
{
private int weaponDamage;
private final EnumCoToolMaterial toolMaterial;
public ItemCoSword(int par1, EnumCoToolMaterial par2EnumToolMaterial)
{
super(par1);
toolMaterial = par2EnumToolMaterial;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterial.getMaxUses());
weaponDamage = 10 + par2EnumToolMaterial.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
}
The Meaning of Life, the Universe, and Everything.
Join Date:
7/1/2012
Posts:
76
Minecraft:
Nukeannihilation
Member Details
Hi Techguy,
I found the way to make items and blocks go into the creative inventory. In the BlockNAMEHERE under public BlockNAMEHERE(par1,par2) you put "this.setCreativeTab(CreativeTabs.creativetabnamehere) extremely easy
For items it's different. Same place but worded differently;
this.setTabToDisplayOn(CreativeTabs.creattivetabnamehere)
Thank you for this, been trying to figure this out for quite a while!
1. how do you change the amount of damage armour can withstand till it breaks?
2. can you make an item have an enchantment when you craft it?
3. my ore isnt smelting when i put it in the furnace... im still doing 1.2.5 till entities are fixed... here is the code:
ModLoader.addSmelting(SpotOre.blockIndexInTexture, new ItemStack(BlackSpot, 3));
i put it in the slot and nothing happens, even if the fuel is still burning :/ my other item that gets smelted works with this code and i dont understand why this doesnt work specifically for the ore :/
4. for achievements, how do you use your own item when crafted?
if(itemstack.itemID == block.dirt.blockID)
i want the "dirt" to be my sword, but what would i put? when i put just its name, it gives me errors.... help plz??
1.You would change that in where the armor statistics are defined.
2.Probably. Not sure how, but probably.
3.Try this:
ModLoader.addSmelting(SpotOre.blockID, new ItemStack(BlackSpot, 3));
The problem was you were telling it to index the texture... it's difficult to explain, but it should be fixed. If you're going to add it in 1.3, though, a change took place, where it would be
ModLoader.addSmelting(SpotOre.blockID, new ItemStack(BlackSpot, 3), 0);
I'm not sure what that extra value does, but it needs to be there in 1.3.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
1. how do you change the amount of damage armour can withstand till it breaks?
2. can you make an item have an enchantment when you craft it?
3. my ore isnt smelting when i put it in the furnace... im still doing 1.2.5 till entities are fixed... here is the code:
ModLoader.addSmelting(SpotOre.blockIndexInTexture, new ItemStack(BlackSpot, 3));
i put it in the slot and nothing happens, even if the fuel is still burning :/ my other item that gets smelted works with this code and i dont understand why this doesnt work specifically for the ore :/
4. for achievements, how do you use your own item when crafted?
if(itemstack.itemID == block.dirt.blockID)
i want the "dirt" to be my sword, but what would i put? when i put just its name, it gives me errors.... help plz??
On the fourth one, you need to replace block.dirt.blockID with this. if it's an item, mod_YourMod.itemhere.shiftedIndex. If it's a block, mod_YourMod.blockhere.blockID.
On the fourth one, you need to replace block.dirt.blockID with this. if it's an item, mod_YourMod.itemhere.shiftedIndex. If it's a block, mod_YourMod.blockhere.blockID.
Oh, whoops, didn't catch that.
Thanks for letting me know what the new value is.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
...
5. how do you make an achievment where you kill a specific mob, eg. creeper?
Well, the CowTipper achievement is actually called when you pick up a piece of leather, not when you kill the cow. So, I guess, you could do this after you define the achievement:
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
To post a comment, please login or register a new account.
I did as you said but nothing has changed
P.S I copied all of the tutorial "Block"
Screenshots
http://savepic.su/2240268.htm
http://savepic.org/2419256.png
Try saving your block class. Eclipse doesn't pick up the constructor change until it has been saved.
together they are powerful beyond imagination."
ALL WORK`S THX
It isn't a problem with EntityTracker. It is a problem with us not being able to add our own entities to it without editing it. No mods will be compatible if we all edit it. We are presented with a problem, that hopefully Risugami can solve by giving us a ModLoader method. Not saying we should all just give up and leave the work to Risugami, because we shouldn't. We can however remain hopeful he will give us a great hand like he already has done so much.
together they are powerful beyond imagination."
Ok thanks
\/
\/
\/
Apparently ModLoader has updated and fixed generation. I am testing now and will let you know.
together they are powerful beyond imagination."
I'm sure he would have received several hundred messages regarding it
EDIT: No, hasn't been fixed. We'll have to keep trying to fix it ourselves, I guess.
together they are powerful beyond imagination."
together they are powerful beyond imagination."
I and my friend are having the same problem.
please check it out. I am not the only one.
BlockDirtcrop
package net.minecraft.src; import java.util.Random; public class BlockDirtcrop extends BlockFlower { public BlockDirtcrop(int i, int j) { super(i, j); blockIndexInTexture = j; setTickRandomly(true); float f = 0.5F; setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); } /** * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of * blockID passed in. Args: blockID. * This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow. */ protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == Block.tilledField.blockID; } /** * Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class. */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { super.updateTick(par1World, par2, par3, par4, par5Random); if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { int i = par1World.getBlockMetadata(par2, par3, par4); if (i < 8) { float f = getGrowthRate(par1World, par2, par3, par4); if (par5Random.nextInt((int)(25F / f) + 1) == 0) { i++; par1World.setBlockMetadataWithNotify(par2, par3, par4, i); } } } } /** * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below * this one). Args: x, y, z */ private float getGrowthRate(World par1World, int par2, int par3, int par4) { float f = 1.0F; int i = par1World.getBlockId(par2, par3, par4 - 1); int j = par1World.getBlockId(par2, par3, par4 + 1); int k = par1World.getBlockId(par2 - 1, par3, par4); int l = par1World.getBlockId(par2 + 1, par3, par4); int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1); int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1); int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1); int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1); boolean flag = k == blockID || l == blockID; boolean flag1 = i == blockID || j == blockID; boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID; for (int i2 = par2 - 1; i2 <= par2 + 1; i2++) { for (int j2 = par4 - 1; j2 <= par4 + 1; j2++) { int k2 = par1World.getBlockId(i2, par3 - 1, j2); float f1 = 0.0F; if (k2 == Block.tilledField.blockID) { f1 = 1.0F; if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0) { f1 = 3F; } } if (i2 != par2 || j2 != par4) { f1 /= 4F; } f += f1; } } if (flag2 || flag && flag1) { f /= 2.0F; } return f; } /** * The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom. */ public int getRenderType() { return 6; } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); if (par1World.isRemote) { return; } int i = 3 + par7; for (int j = 0; j < i; j++) { if (par1World.rand.nextInt(15) <= par5) { float f = 0.7F; float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_dirtcrop.dirtseed)); entityitem.delayBeforeCanPickup = 10; par1World.spawnEntityInWorld(entityitem); } } } /** * Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below). This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is not equal to 7 then drop nothing (-1 means nothing) */ public int idDropped(int i, Random random, int j) { int n = random.nextInt(2); if (i == 8) { if ( n == 1) { return mod_dirtcrop2.dirtseed2.shiftedIndex; } else { return mod_Sean.hd1.blockID; } } else { return -1; } } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 1; } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata. * As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined. * The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth. */ public int getBlockTextureFromSideAndMetadata(int i, int j) { if(j == 0) { return mod_dirtcrop.cropStageOne; } if(j == 1) { return mod_dirtcrop.cropStageOne; } if(j == 2) { return mod_dirtcrop.cropStageTwo; } if(j == 3) { return mod_dirtcrop.cropStageThree; } if(j == 4) { return mod_dirtcrop.cropStageFour; } if(j == 5) { return mod_dirtcrop.cropStageFive; } if(j == 6) { return mod_dirtcrop.cropStageSix; } if(j == 7) { return mod_dirtcrop.cropStageSeven; } if(j == 8) { return mod_dirtcrop.cropStageEight; } return j; } }mod_dirtcrop
package net.minecraft.src; public class mod_dirtcrop extends BaseMod { //Just a standard block. public static final Block dirtcrop = new BlockDirtcrop(220, 0).setBlockName("dirtcrop"); //This is a fairly standard item but it has two new arguments. The first is the block it plants, in this case is our new crop "cropNameHere". The second is the block that is required to be right clicked on to plant the seeds. //We are using tilled field/dirt for this crop but you can change it to whatever you like. Remember to change it in the block class as well. public static final Item dirtseed = new ItemDirtseed(2500, dirtcrop.blockID, Block.tilledField.blockID).setItemName("dirtseed"); //These static ints are the textures of the crop in its various stages of growth. public static int cropStageOne = ModLoader.addOverride("/terrain.png", "crop1.png"); public static int cropStageTwo = ModLoader.addOverride("/terrain.png", "crop2.png"); public static int cropStageThree = ModLoader.addOverride("/terrain.png", "crop3.png"); public static int cropStageFour = ModLoader.addOverride("/terrain.png", "crop4.png"); public static int cropStageFive = ModLoader.addOverride("/terrain.png", "crop5.png"); public static int cropStageSix = ModLoader.addOverride("/terrain.png", "crop6.png"); public static int cropStageSeven = ModLoader.addOverride("/terrain.png", "crop7.png"); public static int cropStageEight = ModLoader.addOverride("/terrain.png", "crop8.png"); public void load() { dirtcrop.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "crop.png"); ModLoader.registerBlock(dirtcrop); ModLoader.addName(dirtcrop, "Nutrition Absorption"); dirtseed.iconIndex = ModLoader.addOverride("/gui/items.png", "seed.png"); ModLoader.addName(dirtseed, "Absorption Seeds"); ModLoader.addRecipe(new ItemStack(dirtseed), new Object [] { "N", "S", 'N', mod_Sean.SeanFood, 'S', Item.seeds }); } public String getVersion() { return "1.3.1"; } }-
View User Profile
-
View Posts
-
Send Message
Curse Premiumall my tools are normal items, but works normal like an pickaxe or so.
In the code is no error and when i start the game theres no error too.
package net.minecraft.src; public class ItemCoSword extends Item { private int weaponDamage; private final EnumCoToolMaterial toolMaterial; public ItemCoSword(int par1, EnumCoToolMaterial par2EnumToolMaterial) { super(par1); toolMaterial = par2EnumToolMaterial; maxStackSize = 1; setMaxDamage(par2EnumToolMaterial.getMaxUses()); weaponDamage = 10 + par2EnumToolMaterial.getDamageVsEntity(); } /** * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if * sword */ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { return par2Block.blockID != Block.web.blockID ? 1.5F : 15F; } /** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. */ public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { par1ItemStack.damageItem(1, par3EntityLiving); return true; } public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) { par1ItemStack.damageItem(2, par6EntityLiving); return true; } /** * Returns the damage against a given entity. */ public int getDamageVsEntity(Entity par1Entity) { return weaponDamage; } }Thank you for this, been trying to figure this out for quite a while!
-
View User Profile
-
View Posts
-
Send Message
Retired Staff1.You would change that in where the armor statistics are defined.
2.Probably. Not sure how, but probably.
3.Try this:
The problem was you were telling it to index the texture... it's difficult to explain, but it should be fixed. If you're going to add it in 1.3, though, a change took place, where it would be
I'm not sure what that extra value does, but it needs to be there in 1.3.
The last value added in 1.3 is the amount of EXP you get after smelting.
On the fourth one, you need to replace block.dirt.blockID with this. if it's an item, mod_YourMod.itemhere.shiftedIndex. If it's a block, mod_YourMod.blockhere.blockID.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffOh, whoops, didn't catch that.
Thanks for letting me know what the new value is.
Try this.
ModLoader.addRecipe(new ItemStack (BlackRockHelmet, 1), new Object[] {"XXX", "X X", ' X ', BlackRock});-
View User Profile
-
View Posts
-
Send Message
Retired StaffWell, the CowTipper achievement is actually called when you pick up a piece of leather, not when you kill the cow. So, I guess, you could do this after you define the achievement:
public void onItemPickup(EntityPlayer entityplayer, ItemStack itemstack) { if(itemstack.itemID == Item.gunpowder.shiftedIndex) { entityplayer.addStat(WhateverYourAchievementNameIs, 1); } }And that would be called whenever you pick up a piece of gunpowder. You can change it as you like.