[[DolphinsWithGills]] - Dolphin Protection from Drowning and Dryout
This simple yet effective Minecraft modifier saves dolphins from dying by drowning or drying out. Thanks to this plugin, you'll never see these beautiful creatures perish from lack of water.
Main Functionality:
The modification automatically blocks damage to dolphins in two critical situations:
- Drowning damage from prolonged underwater stays
- Dryout damage from extended time on land
Technical Implementation:
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
if (event.getEntityType() != EntityType.DOLPHIN) return;
DamageCause cause = event.getCause();
if (cause == DamageCause.DROWNING) event.setCancelled(true);
if (cause == DamageCause.DRYOUT) event.setCancelled(true);
}
The code monitors mob damage events and automatically cancels drowning and dryout damages when applied to dolphins.