if (hitBlock != null) 
{
	if(world.getBlockID(hitBlock.x,hitBlock.y,hitBlock.z) == 31)
	{
		world.setBlockID(hitBlock.x,hitBlock.y,hitBlock.z,0);
		sound.playSound3D("step.grass",hitBlock.x,hitBlock.y,hitBlock.z);
		
		var rand = Math.floor(Math.random() * 20);
		switch (rand) 
		{
		case 0:
		case 1:
			player.dropItem(Item(459, 3));
			break; // 1 in 10 chance for 3 hearts
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 7:
			player.dropItem(Item(353));
			break; // 3 in 10 chance for 1 sugar (currency placeholder)
		case 8:
			player.dropItem(Item(459));
			break; // 1 in 20 chance for a heart
                case 9:
			player.dropItem(Item(262,10));
			break; // 1 in 20 chance for 10 arrows.
		}
		itemSearch = player.getEntitiesWithinRange(0.2);
		for (var i = 0; i < itemSearch.length; i++) 
		{
			var ent = itemSearch[i];
			if (ent.getClassType() == "Item") {
				ent.setPosition(hitBlock.x + 0.5, hitBlock.y + 0.5, hitBlock.z + 0.5);
			}   
		}
	}
}