player.damage(damageToDeal); // For dealing damage to entity convert it to Damageable if (entity instanceof Damageable) { ((Damageable) entity).damage(damageToDeal); }