@Override public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter) { if(provider == null) return super.createArrow(worldIn, stack, shooter); return provider.provide(worldIn, stack, shooter); }
@Override public EntityArrow getFiredArrow(ItemStack arrow, World world, EntityPlayer player, float charge) { return ((ItemArrow)arrow.getItem()).createArrow(world, arrow, player); } }
@Override @Nonnull public EntityArrow createArrow(@Nonnull World worldIn, @Nonnull ItemStack stack, EntityLivingBase shooter) { try { return arrows[stack.getMetadata()].getConstructor(World.class, EntityLivingBase.class).newInstance(worldIn, shooter); }catch (Throwable e){ return super.createArrow(worldIn, stack, shooter); } }
EntityArrow entityarrow = itemarrow.createArrow(world, itemstack, shooter); entityarrow.shoot(shooter, shooter.rotationPitch, shooter.rotationYaw, 0.0F, f * 3.0F, 1.0F);
public EntityArrow createArrow(World world, ItemStack arrowStack, ItemStack bowStack, boolean customArrow, EntityPlayer player) { if (customArrow) { return ((IToolBow) bowStack.getItem()).createEntityArrow(world, bowStack, player); } if (isArrow(arrowStack)) { return ((ItemArrow) arrowStack.getItem()).createArrow(world, arrowStack, player); } if (isQuiver(arrowStack)) { return ((IToolQuiver) arrowStack.getItem()).createEntityArrow(world, arrowStack, player); } return ((ItemArrow) Items.ARROW).createArrow(world, arrowStack, player); }
public void spawnArrow(World worldIn, EntityPlayer player, ItemStack stackBow, float charge, Vec3d offsetVector) { //TODO: custom ammo one day? The event does not send ammo only the bow ItemArrow itemarrow = (ItemArrow) (Items.ARROW); EntityArrow entityarrow = itemarrow.createArrow(worldIn, stackBow, player); entityarrow.pickupStatus = EntityArrow.PickupStatus.DISALLOWED; //off set bow to the side using the vec, and then aim entityarrow.posX += offsetVector.x; entityarrow.posY += offsetVector.y; entityarrow.posZ += offsetVector.z; entityarrow.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, charge, 1.0F); //from ItemBow vanilla class if (charge == 1.0F) { entityarrow.setIsCritical(true); } //extract enchants from bow int power = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, stackBow); if (power > 0) { entityarrow.setDamage(entityarrow.getDamage() + power * 0.5D + 0.5D); } int punch = EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, stackBow); if (punch > 0) { entityarrow.setKnockbackStrength(punch); } if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, stackBow) > 0) { entityarrow.setFire(100); } //and go worldIn.spawnEntity(entityarrow); } }
EntityArrow entityarrow = itemarrow.createArrow(world, arrowStack, player); entityarrow.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, velocity * 3.0F, 1.0F);
EntityArrow entityarrow = itemarrow.createArrow(worldIn, itemstack, entityplayer); entityarrow.shoot(entityplayer, entityplayer.rotationPitch, entityplayer.rotationYaw, 0.0F, drawRatio * 3.0F * getForceMultiplier(upgrade), 0.25F); // ATTENTION:
entityArrow = new EntitySentientArrow(world, entityLiving, type, amount, getLevel(soulsRemaining)); } else entityArrow = itemarrow.createArrow(world, itemstack, player); entityArrow.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, newArrowVelocity, 1.0F);
EntityArrow entityarrow = itemarrow.createArrow(worldIn, itemstack, entityplayer); entityarrow.shoot(entityplayer, entityplayer.rotationPitch, entityplayer.rotationYaw, 0.0F, power * 3.0F, 1.0F);
EntityArrow arrow = arrowItem.createArrow(world, arrowStack, player); arrow.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, f * 3.0F * speedMod, 1.0F + (1.5F - f) * shot); arrow.setDamage(arrow.getDamage() * (1 + arrowDamageMultiplier));
ItemStack type = getArrowForMob(skeleton); if (type.getItem() instanceof ItemArrow) { EntityArrow mbArrow = ((ItemArrow)type.getItem()).createArrow(skeleton.world, type, skeleton); if (!(mbArrow instanceof EntityTippedArrow)) { EntityLivingBase target = skeleton.getAttackTarget();