import * as vector from "../utils/vector";

export function tick20(entity) {
    const entities = entity.dimension.getEntities({
        location: vector.subtract(entity.location, {
            x: 0,
            y: 8,
            z: 0
        }),
        maxDistance: 0.5,
        excludeFamilies: ['hf_mzs_umvuthana', 'inanimate', "player"]
    });
    if (entities[0] === undefined || !entities[0].isValid())
        return;
    entities[0].setOnFire(1.5);

    if (entity.dimension.getBlockFromRay(entity.location, vector.down, {
        maxDistance: 8.1,
        includePassableBlocks: false,
        includeLiquidBlocks: false
    }) !== undefined) {
        entity.remove();
        return;
    }
}