spigot heal player

Java
if (!player.isDead()) {
	try {
		player.setHealth(player.getHealth()+hpToHeal);
	} catch (Exception exception) { exception.printStackTrace(); }
}
Source

Also in Java: