I am trying to create a custom event for a mod that fires when the player's potion effect runs out.
EntityLivingBase class has the method onFinishedPotionEffect which would be the perfect place to call my custom event but since I cannot edit the class, how would I go about overriding it and calling my custom event inside it? If I extend the class, how would I make Minecraft use my class instead of the normal one?
Or if what I am trying to do is impossible, how would I create a custom event that is called when a potion effect runs out besides listening to the tick event?