Golden hearts, or absorption hearts, are not accessible in your current spigot version 1.12.2. The getter/setter were added in this commit. As they are simply wrapping calls against the EntityPlayer instance, you could try to use NMS. This way you could access the values in spigot 1.12.2.