// priority: 100

const createdCaptures = [];

function createList() {
    const chickens = Ingredient.of('#chickenblock:chickens').getStacks()

    for (const chicken of chickens) {
        createdCaptures.push(
            Item.of("resourcechickens:catcher_item")
                .withNBT({
                    entityCaptured: {
                        Age: 0,
                        id: chicken.id
                            .replace("_chicken_spawn_egg", "")
                    }
                })
        )
    }
}

FTBQuestsEvents.customFilterItem(event => {
    if (createdCaptures.length == 0) {
        console.log("Creating chicken catcher list...")
        createList();
    } else {
        console.log("Chicken catcher list already created!")
    }

    event.addStacks(createdCaptures)
});