Thanks for the ray tutorial due to it I've made a sword that teleports you to where you are looking. Awesome tut!
what command did you use to get this to work? I have looked all over and cannot find it at all. I figured I would use the ender pearl code, but that requires the item to be thrown.
Help please? It says there is someything wrong with
func_35205_y
But i don't know what is wrong with it. Minecraft loads but when i try to go onto a world it crashes and comes up with this error:
Mods loaded: 2
ModLoader 1.2.5
mod_Darkstone 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 204613 --------
Generated 24/05/12 11:14 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.6.0_30, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce GT 430/PCI/SSE2 version 4.2.0, NVIDIA Corporation
java.lang.Error: Unresolved compilation problem:
The method func_35205_y() is undefined for the type EntityPlayer
at net.minecraft.src.DarkBow.onUpdate(DarkBow.java:21)
at net.minecraft.src.ItemStack.updateAnimation(ItemStack.java:465)
at net.minecraft.src.InventoryPlayer.decrementAnimations(InventoryPlayer.java:259)
at net.minecraft.src.EntityPlayer.onLivingUpdate(EntityPlayer.java:525)
at net.minecraft.src.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:259)
at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:694)
at net.minecraft.src.EntityPlayer.onUpdate(EntityPlayer.java:281)
at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2195)
at net.minecraft.src.World.updateEntity(World.java:2163)
at net.minecraft.src.World.updateEntities(World.java:2037)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1897)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT cb68d6aa ----------
Oh and here is my Darkbow.java:
package net.minecraft.src;
import java.util.Random;
public class DarkBow extends Item
{
public DarkBow(int i)
{
super(i);
maxStackSize = 1;
setMaxDamage(384);
}
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
EntityPlayer entityplayer = (EntityPlayer)entity;
ItemStack itemstack1 = entityplayer.inventory.getCurrentItem();
if(entityplayer.isUsingItem() && itemstack1.itemID == mod_Darkstone.Darkbow.shiftedIndex)
{
int k = itemstack.getMaxItemUseDuration() - entityplayer.func_35205_y();
if(k >= 18)
{
iconIndex = mod_Darkstone.darkbow4;
}else
if(k > 13)
{
iconIndex = mod_Darkstone.darkbow3;
}else
if(k > 0)
{
iconIndex = mod_Darkstone.darkbow2;
}else
iconIndex = mod_Darkstone.darkbow1;
}
}
public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer entityplayer, int i)
{
int j = getMaxItemUseDuration(itemstack) - i;
float f = (float)j / 20F;
f = (f * f + f * 2.0F) / 3F;
if((double)f < 0.10000000000000001D)
{
return;
}
if(f > 1.0F)
{
f = 1.0F;
}
EntityDarkArrow entityfirearrow = new EntityDarkArrow(world, entityplayer, f * 2.0F);
itemstack.damageItem(1, entityplayer);
world.playSoundAtEntity(entityplayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
world.spawnEntityInWorld(entityfirearrow);
}
public ItemStack onFoodEaten(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
return itemstack;
}
public int getMaxItemUseDuration(ItemStack itemstack)
{
return 0x11940;
}
public EnumAction getItemUseAction(ItemStack itemstack)
{
return EnumAction.bow;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
return itemstack;
}
}
Guys, I have a problem. When I shoot my bow,it goes through all textures and ends at the bow4 texture. I want it to change to the original bow texture. How do I do that?
Is your mod incomptible with forge if not i recommend getting forge as it fixes this bug with the bow stoping att the last animation if not tell me and i can explain in a pm or send me the code and i will make it work
public int getItemIcon(ItemStack par1ItemStack, int par2)
{
int i = super.getItemIcon(par1ItemStack, par2);
if (par1ItemStack.itemID == Item.fishingRod.shiftedIndex && fishEntity != null)
{
i = par1ItemStack.getIconIndex() + 16;
}
else
{
if (par1ItemStack.getItem().func_46058_c())
{
return par1ItemStack.getItem().func_46057_a(par1ItemStack.getItemDamage(), par2);
}
[b] if (itemInUse != null && par1ItemStack.itemID == Item.bow.shiftedIndex)
{
int j = par1ItemStack.getMaxItemUseDuration() - itemInUseCount;
if (j >= 18)
{
return 133;
}
if (j > 13)
{
return 117;
}
if (j > 0)
{
return 101;
}
}[/b]
if (itemInUse != null && par1ItemStack.itemID == mod_mb.StoneBow.shiftedIndex)
{
int j = par1ItemStack.getMaxItemUseDuration() - itemInUseCount;
if (j >= 18)
{
return mod_mb.StoneBow4;
}
if (j > 13)
{
return mod_mb.StoneBow3;
}
if (j > 0)
{
return mod_mb.StoneBow2;
}
}
if (itemInUse != null && par1ItemStack.itemID == mod_mb.IronBow.shiftedIndex)
{
int j = par1ItemStack.getMaxItemUseDuration() - itemInUseCount;
if (j >= 18)
{
return mod_mb.IronBow4;
}
if (j > 13)
{
return mod_mb.IronBow3;
}
if (j > 0)
{
return mod_mb.IronBow2;
}
}
}
return i;
}
This is EntityPlayer.java
if you copy the bow's method like i did and replace it with the textures like Stewie did in that order, it will work like a charm.
If Facebook, Twitter and MySpace were all distroyed, 90% of teenagers would die. If you're one of the 10% that would be laughing, copy this to your signature and hope it happens.
I am making a custom crossbow, and I tried the method for the bow animations, and only my 4th texture displays when I right-click, and when I shoot (after another right-click) it just displays the texture for the quiver.
Every thing else works like a charm!
Rollback Post to RevisionRollBack
If Facebook, Twitter and MySpace were all distroyed, 90% of teenagers would die. If you're one of the 10% that would be laughing, copy this to your signature and hope it happens.
I am making a custom crossbow, and I tried the method for the bow animations, and only my 4th texture displays when I right-click, and when I shoot (after another right-click) it just displays the texture for the quiver.
Guys, I have a problem. When I shoot my bow,it goes through all textures and ends at the bow4 texture. I want it to change to the original bow texture. How do I do that?
Again, thanks a lot.
Another question:
I want to make my arrow create (a block of) fire on the ground when it hits the ground. However, i only want it to happen when the arrow is critical.
For the bolt:
Now this works. However, if i put before (or after)
it doesn't produce fire at all.
I wonder, how can i fix this?
the bracket count checks out.
Thanks a lot for the effort!
what command did you use to get this to work? I have looked all over and cannot find it at all. I figured I would use the ender pearl code, but that requires the item to be thrown.
But i don't know what is wrong with it. Minecraft loads but when i try to go onto a world it crashes and comes up with this error:
Oh and here is my Darkbow.java:
Can't make it work. Look:
- original -1 -2 -3
The order is
But I don't want the arrow to disappear.
I put it on forge. Bow still doesn't works.
You said to return iconIndexes. I did it, and it's stuck at the diamond helmet pic.
This is EntityPlayer.java
if you copy the bow's method like i did and replace it with the textures like Stewie did in that order, it will work like a charm.
What has this been replaced by?
EDIT: I think I figured it out.
Every thing else works like a charm!
to fix your animation errors, all i did was move the if statement, and it's animation works perfectly.
just change the mod_ stuff to your mod_ and your good!, if this helped you, please head on over to my tutorials page, ;D
http://www.minecraftforum.net/topic/1281244-17612-fullmetalscripting-new-crops-tut/
Its addRenderer Not AddRenderer