#.replaceIngredient() not working

10 messages · Page 1 of 1 (latest)

hearty crow
#

So my code is this:

    const potionRecipes = (potionID) => {
        // [...] Some other recipes that work fine
        event.shapeless(
            `4x kubejs:${potionID}`,
            [`kubejs:${potionID}_bucket`, 'minecraft:glass_bottle', 'minecraft:glass_bottle', 'minecraft:glass_bottle', 'minecraft:glass_bottle']
        ).replaceIngredient(`kubejs:${potionID}_bucket`, 'minecraft:bucket')
        .id(`shapeless/${potionID}`);
     };```
The recipe works just fine

However, it seems that it doesn't like my template strings. I also tried using `Item.of('kubejs:${potionID}_bucket')` (pretend the ' are backticks, markdown), but without success.

If I replace it with `'minecraft:glass_bottle'` it does only replace the bottles
opal juniperBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

hearty crow
#

Is this intentional? Am I doing something wrong? Is this a bug?

fiery condor
#

event.replaceIngredient() , not event.shapeless()

#

Those are mutually exclusive

hearty crow
#

what?

#

.replaceIngredient() applies to a specific recipe, how is it supposed to know which recipe if you don't call it on that recipe?

#

I did a dirty fix by just doing these all outside of the potionRecipes, and it worked fine

#

the issue of it not working lies with the template string

fiery condor
#

I apologize, I wasn't looking closely enough at the code before responding. For some reason my brain was reading that as replaceInput, not replaceIngredient. My mistake!