import * as mc from "@minecraft/server"
import * as racoAPI from "../raco-API"

export function babyFilterTick(block){
    let open = false
    const entities = block.dimension.getEntities({location:block.above().center(), maxDistance:0.65})
    for (const entity of entities){
        if (entity?.getComponent('minecraft:is_baby')){
            open = true
            entity.teleport({x:block.center().x, y:block.y-0.5, z:block.center().z})
        }
    }
    racoAPI.setPermutation(block, 'vtng_rt:open', open)
}