I am trying to make a Mob Stacker plugin but i've ran into a small problem. When the entity dies i have no idea how to cancel the entity from dying. Please help.
You can't cancel the death event of entities or players. You can, however, check if the damage dealt to an enemy is enough to kill them, and if so, cancel the damage, and set their health back to max, and remove one mob from the stack.
Don't forget to listen to the EntityDamageEvent on the HIGHEST priority (or a priority higher than any other plugins that listen to it).