Thank you for that tutorial really helpful!
Now i used the template/code you have here to make a Crossbow and i need my Crossbow to shoot a Bolt instead of arrow, can you by any chance help me with that?
I tried to answer someone's question, then it got all weird and wrote stuff like &(*56(*&_0($43654***, and by the time I fixed it someone else had answered...
One thing though, does anyone else bow render sideways and smaller in third person view? Also the first person view zoom effect does not work. Thank you for your time.
One thing though, does anyone else bow render sideways and smaller in third person view? Also the first person view zoom effect does not work. Thank you for your time.
Hm, I never tried 3rd person view. And yes, I know the zoom effect doesn't work. I'm not sure on how to implement that. If anyone could help, that would be great!
Hm, I never tried 3rd person view. And yes, I know the zoom effect doesn't work. I'm not sure on how to implement that. If anyone could help, that would be great!
I even made a custom item render class for this bow to adjust the placement of the bow in-hand from third person view, but then the first person view is pointing sideways. I have tried to track down instances in the render classes where it specifies item bow but I must be missing something.
Help please! I've spent the last 6 waking hours of my day trying to get the stupid bow animation on my bow to work and I've tried everything. I thought this would work but it doesn't Please Help. Heres what I got
package net.minecraft.src;
import java.util.Random;
public class ItemEpicBow extends ItemBow
{
private Random rand = new Random();
public ItemEpicBow(int var1)
{
super(var1);
this.maxStackSize = 1;
this.setMaxDamage(500);
this.bFull3D = true;
this.setCreativeTab(CreativeTabs.tabCombat);
}
/**
* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
* update it's contents.
*/
public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5)
{
EntityPlayer var6 = (EntityPlayer)var3;
ItemStack var7 = var6.inventory.getCurrentItem();
if (var6.isUsingItem() && var7.itemID == mod_EpicFace.EpicBow.itemID)
{
int var8 = var1.getMaxItemUseDuration() - var6.getItemInUseCount();
if (var8 >= 18)
{
this.iconIndex = mod_EpicFace.EpicBow4;
}
else if (var8 > 13)
{
this.iconIndex = mod_EpicFace.EpicBow3;
}
else if (var8 > 0)
{
this.iconIndex = mod_EpicFace.EpicBow2;
}
}
else
{
this.iconIndex = mod_EpicFace.EpicBow.iconIndex;
}
}
/**
* called when the player releases the use item button. Arguments: ItemStack, world, EntityPlayer, itemInUseCount
*/
public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4)
{
boolean var5 = var3.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, var1) > 0;
if (var5 || var3.inventory.hasItem(Item.arrow.itemID))
{
int var6 = this.getMaxItemUseDuration(var1) - var4;
float var7 = (float)var6 / 20.0F;
var7 = (var7 * var7 + var7 * 2.0F) / 3.0F;
if ((double)var7 < 0.1D)
{
return;
}
if (var7 > 1.0F)
{
var7 = 1.0F;
}
EntityArrow var8 = new EntityArrow(var2, var3, var7 * 2.0F);
if (var7 == 1.0F)
{
var8.setIsCritical(true);
}
int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, var1);
if (var9 > 0)
{
var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D);
}
int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, var1);
if (var10 > 0)
{
var8.setKnockbackStrength(var10);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, var1) > 0)
{
var8.setFire(100);
}
var1.damageItem(1, var3);
var2.playSoundAtEntity(var3, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F);
if (!var5)
{
var3.inventory.consumeInventoryItem(Item.arrow.itemID);
}
else
{
var8.canBePickedUp = 2;
}
if (!var2.isRemote)
{
var2.spawnEntityInWorld(var8);
var8.setDamage(var8.getDamage() * 1.15D);
this.iconIndex = mod_EpicFace.EpicBow1;
}
}
ItemStack var11 = var3.inventory.getCurrentItem();
if (var11.itemID != mod_EpicFace.EpicBow.itemID)
{
this.iconIndex = mod_EpicFace.EpicBow1;
}
}
public ItemStack onFoodEaten(ItemStack var1, World var2, EntityPlayer var3)
{
return var1;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack var1)
{
return 72000;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack var1)
{
return EnumAction.bow;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Arguments: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3)
{
if (var3.capabilities.isCreativeMode || var3.inventory.hasItem(Item.arrow.itemID))
{
var3.setItemInUse(var1, this.getMaxItemUseDuration(var1));
}
return var1;
}
/**
* Return the EnchantAbility factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return 1;
}
}
Rollback Post to RevisionRollBack
*Cue corny signature* Dood: "Where can I find good quality videos?" Other dood: Check out xVert77x!
Try copying the arrow class files, and make sure you check out this: http://www.minecraftforum.net/topic/1417041-mod-entity-problem-updated-with-forge/
I know it says forge, but it was UPDATED with forge. I know it edits base classes, but those classes it edits won't be a problem.
What?
I'm using ModLoader so i don't think forge would be off help.
Right. But that tutorial works for ModLoader. I tried it.
I tried to answer someone's question, then it got all weird and wrote stuff like &(*56(*&_0($43654***, and by the time I fixed it someone else had answered...
Bleach Mod
One thing though, does anyone else bow render sideways and smaller in third person view? Also the first person view zoom effect does not work. Thank you for your time.
Hm, I never tried 3rd person view. And yes, I know the zoom effect doesn't work. I'm not sure on how to implement that. If anyone could help, that would be great!
Where it says
Or anywhere else it says EntityArrow, replace it with EntitySnowball, I think.
I even made a custom item render class for this bow to adjust the placement of the bow in-hand from third person view, but then the first person view is pointing sideways. I have tried to track down instances in the render classes where it specifies item bow but I must be missing something.
public boolean isFull3D()
{
return true;
}
into my bow class and everything works fine now.
?
Not in Minecraft's ItemBow class.
Ah. You didn't follow the tutorial?