var k = [];

for (var i = 0; i < spawnedEntities.length; i++) {
    k[i] = 0;
}

function drop(ent) {
    var heartChance = (player.getMaxHealth() / player.getHealth()) / 10;
    if (player.getHealth() == player.getMaxHealth()) {
        heartChance = 0;
    }
    if (Math.random() <= heartChance || player.getHealth() <0) {
        ent.dropItem(Item(459));
        return;
    }
    return;
}