Posted July 30, 201213 yr Hello, I want to create poison arrows. The problem is that i don't know how to do that. I already found a tutorial, but this one is with Modloader and I'Ve to create a custom bow. Is there a tutorial how i can only create custom arrows with Forge?
July 30, 201213 yr Sadly there is no tutorial for this, but, when i figure out how to use it, i will write one. Somehow there is a way to not have to use custom bows, but rather use the IArrowLoose and IArrowNock handlers. I haven't successfully got either working. But, in order to get more help we need code. Just some tips, what exactly is the problem you're having, post your code, be patient.
July 31, 201213 yr Author Ok. The problem is, that the bow not uses my entity. It still uses the standard arrow. My code looks the same like the code in this topic: http://minecraftforge.net/forum/index.php/topic,92.msg467.html#msg467 He has the same problem. I think i have to create a new Renderer or something, but how?
August 1, 201213 yr Author Yep. I don't know how to use them. I only have the AddRenderer in my mod_file.java, EntityPoisonArrow/RenderPoisonArrow and ItemPoisonArrow. But the bow don't use my entity.
August 1, 201213 yr Author Now, I use a custom bow and arrows, because I didn't know how to make them in Forge
August 11, 201213 yr This may be done completely wrong, but i got a way to have it work. package bonesticks.items; import bonesticks.bEntityArrow; import bonesticks.bItem; import net.minecraft.src.Enchantment; import net.minecraft.src.EnchantmentHelper; import net.minecraft.src.EntityArrow; import net.minecraft.src.EntityPlayer; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraft.src.World; import net.minecraft.src.forge.IArrowLooseHandler; import net.minecraft.src.forge.IArrowNockHandler; import net.minecraft.src.forge.ITextureProvider; import net.minecraft.src.forge.MinecraftForge; public class bItemArrow extends Item implements ITextureProvider, IArrowLooseHandler, IArrowNockHandler { public bItemArrow(int par1) { super(par1); } @Override public ItemStack onArrowNock(ItemStack itemstack, World world, EntityPlayer player) { if(player.inventory.hasItem(bItem.boneArrow.shiftedIndex)) { if(itemstack.itemID == Item.bow.shiftedIndex || itemstack.itemID == bItem.Bow.shiftedIndex) { return new ItemStack(bItem.bBow, 1, itemstack.getItemDamage()); } else if (itemstack.itemID == bItem.boneBow.shiftedIndex) { return new ItemStack(bItem.boneBowBA, 1, itemstack.getItemDamage()); } } else if(player.inventory.hasItem(Item.arrow.shiftedIndex)) { if(itemstack.itemID == bItem.boneBowBA.shiftedIndex) { return new ItemStack(bItem.boneBow, 1, itemstack.getItemDamage()); } else if (itemstack.itemID == Item.bow.shiftedIndex || itemstack.itemID == bItem.bBow.shiftedIndex) { return new ItemStack(bItem.Bow, 1, itemstack.getItemDamage()); } } return null; } @Override public boolean onArrowLoose(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { return true; } @Override public String getTextureFile() { return ("/bonesticks/pictures/terrain.png"); } } In short, my understanding is that onArrowLoose is just used to indicate to the arrow to shift the change bows for different arrows.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.