So, i didn't want to open a thread just for this but my brain is almost exploding, i have this script that receives a specified item and returns a specified output when fed to a mob, the thing i want to implement is multiple inputs to a single output, help?
SCRIPT :
ItemEvents.entityInteracted((event) => {
const {item, hand, target, level, server} = event
/**
* Feeds a mob with a specific input item and drops the specified output item.
* @param {string} mob - The type of mob to feed.
* @param {number} input - The ID of the input item.
* @param {number} output - The ID of the output item.
* @param {number} [amount=1] - The amount of output items to drop (default is 1).
*/
let basic_feeding = (mob, input, output, amount) =>{
amount = amount ?? 1
const {x, y, z} = target
if(
target.type == mob &&
hand == 'main_hand' &&
item.id == input
){
item--
target.playSound('entity.item.pickup', 0.3, 1)
target.playSound('entity.fox.bite', 0.8, 1)
server.runCommandSilent(`execute in ${level.dimension} positioned ${x} ${y + 0.5} ${z} run particle minecraft:cloud ~ ~ ~ 0.2 0.2 0.2 0.001 30`)
level.getBlock(x, y, z).popItem(Item.of(output, amount))
}
}
basic_feeding('minecraft:pig', 'minecraft:iron_ingot', 'minecraft:copper_ingot', 3)
})

