I am a mod maker who has run into some issues with making a hook that activates when a player is hit with a splash potion of ANY type. I would like to see a dedicated hook that is fired when potions splash on entities.
If there is another possible way to do this without editing a base class, please inform me ASAP.
EDIT:
Here's some code I came up with...
private boolean checkRecentPotions()
{
EntityPlayer pl = Mod_Main.mc.thePlayer;
AxisAlignedBB var1 = AxisAlignedBB.getBoundingBox(pl.posX - 4.5D, pl.posY - 5.0D, pl.posZ - 4.5D, pl.posX + 4.5D, pl.posY + 2.0D, pl.posZ + 4.5D);
ArrayList potionList = (ArrayList) Mod_Main.mc.theWorld.getEntitiesWithinAABB(EntityPotion.class, var1);
for(int i = 0;i < potionList.size();i++)
{
EntityPotion var4 = (EntityPotion) potionList.get(i);
double tv1 = pl.posX;
double tv2 = pl.posY;
double tv3 = pl.posZ;
double tv4 = var4.posX;
double tv5 = var4.posY;
double tv6 = var4.posZ;
//distance variable if wanted
double distance = Math.sqrt(this.sq(tv1 - tv4) + this.sq(tv2 - tv5) + this.sq(tv3 - tv6);
if(var4.isDead)
{
potionList.remove(i);
return true;
}
}
return false;
}