Where do I put the Use ItemSword#onItemRightClick? My code for the shooting part is here.
First off, Use is not command. Second off he means that you should override onItemRightClick on your Sword class.
So I did it in my LavaSword class and this is my code but there is an error on the ItemSword in the @Override ItemSword#onItemRightClick. I also could get any this, posX, and posY statements to work unless I extended my LavaSword class from my EntityLavaShot class. I don't know if that is correct of if I'm putting things in the right classes.
@Override ItemSword#onItemRightClick
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_)
{
EntityLavaShot entitylavashot = new EntityLavaShot(this.worldObj, this);
double d0 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D;
double d1 = p_82196_1_.posX - this.posX;
double d2 = d0 - entitylavashot.posY;
double d3 = p_82196_1_.posZ - this.posZ;
float f1 = MathHelper.sqrt_double(d1 * d1 + d3 * d3) * 0.2F;
entitylavashot.setThrowableHeading(d1, d2 + (double)f1, d3, 1.6F, 12.0F);
this.worldObj.spawnEntityInWorld(entitylavashot);
}