I made a custom bow, with its own custom arrow and arrow entity. I made an enchantment that can be put on any bow, and I know a way to make my custom arrow explode (in the custom arrow entity class). I have see in the bow class that it tests for enchantments there, and if it has an enchantment like power it will tell the EntityArrow.class to make it damage more. Is there a way I can check if it has my enchantment, and then if it does change this:
if (this.inGround)
{
int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (block == this.field_145790_g && j == this.inData)
{
++this.ticksInGround;
if (this.ticksInGround == 1200) //set to 1 for explosion
{
this.setDead();
//this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5.0F, true);
}
}
else
{
this.inGround = false;
this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
this.ticksInGround = 0;
this.ticksInAir = 0;
}
to the parameters needed to make the arrow explode? Thank you for your help, I am new to modding!