var tunic = pinv.getItemInSlot(38);

if (tunic == null || tunic.getItemID() != GORON_TUNIC)
{
	var ppos = player.getPosition();
	var px = Math.round(ppos.x);
	var py = Math.round(ppos.y);
	var pz = Math.round(ppos.z);	
	var heat = false;
	
	for (var i = px - HEAT_RANGE; i < px + HEAT_RANGE; i++)
	{
		for (var j = py - HEAT_RANGE; j < py + HEAT_RANGE; j++)
		{
			for (var k = pz - HEAT_RANGE; k < pz + HEAT_RANGE; k++)
			{
				if (world.getBlockID(i,j,k) == 11 || world.getBlockID(i,j,k) == 10)	// 11 = Still Lava, 10 = Flowing Lava
				{
					heat = true;
				}
			}
		}
	}
	
	if (heat)
	{
		heatTime -= 1;
		if (heatTime <= 0)
		{
			var pv = player.getVelocity();
			player.attackEntityFrom(player, HEAT_DAMAGE);
			player.setVelocity(pv.x, pv.y, pv.z);	// Prevents knockback - Remove this line if you want heat damage to have knockback
			heatTime = HEAT_DELAY;
		}
	}
}
else
{
	heatTime = HEAT_DELAY;
}
