#How do i implement this?

33 messages · Page 1 of 1 (latest)

sonic crest
#
cuttingRecipe([/.*:stripped_.+_log.*/], [/.*:.+_log.*/], '#forge:tools/cutting');
heavy kayakBOT
#

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

near kettle
#

is cuttingRecipe a function you made?

west meteor
#

??helpyou

fierce steppeBOT
# west meteor ??helpyou

╰( ͡° ͜ʖ ͡° )つ──☆:・゚˜”°•.˜”°• Many Help •°”˜.•°”˜*
Please provide a description of your issue with as much detail as possible. If you have an issue with a script provide the script. Explain what you can see happening and what you expect to happen. Be specific!

Tell us what is happening, we already know it "doesn't work".
Avoid using words like "it", tell us exactly what "it" is.
Don't assume anyone knows what you are talking about, be specific.

Provide screenshots or video if possible.
Provide the log.

near kettle
sonic crest
near kettle
#

that non-code block code is making me anxious as well

sonic crest
#

i know the regex isn't particularily correct, it can match for 0 characters before :

#

but that's not the issue at hand

west meteor
#

well you can’t just say match a stripped log to its non stripped variant

#

you’ll have to guess what the name of either the non stripped variant or the stripped variant is

#

other than that

#

Ingredient.of("#forge:stripped_logs") or Ingredient.of(thatregexabove) will both contain all stripped logs

sonic crest
#

i still don't understand

#

could you give an example please?

near kettle
#

we have absolutely no idea what youre asking.

#

cant read minds

sonic crest
#

that's not a problem anymore

#

but now i've got another one

#
onEvent('recipes', event => {
    let cutting = (outputs, inputs, tool) => {
        event.custom({
            type: 'farmersdelight:cutting',
            ingredients: inputs.map(i => i.toJson()),
            tool: tool,
            result: outputs.map(i => i.toResultJson())
        })
    }

    Ingredient.of('#minecraft:logs').itemIds.forEach((value) => {
        event.remove({type: 'farmersdelight:cutting', input: value});

        let without_tag = value.split(':')[1]

        cutting([Item.of('stripped_' + without_tag), Item.of('immersiveengineering:dust_wood'), Item.of('farmersdelight:tree_bark')], [Item.of(value)], Item.of('#forge:tools/cutting'));
    });
});
#
        cutting([Item.of('stripped_' + without_tag), Item.of('immersiveengineering:dust_wood'), Item.of('farmersdelight:tree_bark')], [Item.of(value)], Item.of('#forge:tools/cutting'));
``` specifically this part
#
Item.of('#forge:tools/cutting')
``` represents all the tools that can be used on a cutting board
#

it's a tag i had already made

#
onEvent('item.tags', event => {
    event.add('forge:tools/cutting', 'notreepunching:iron_saw');
    event.add('forge:tools/cutting', 'notreepunching:gold_saw');
    event.add('forge:tools/cutting', 'notreepunching:diamond_saw');
    event.add('forge:tools/cutting', 'notreepunching:netherite_saw');
    event.add('forge:tools/cutting', 'minecraft:wooden_axe');
    event.add('forge:tools/cutting', 'minecraft:stone_axe');
    event.add('forge:tools/cutting', 'minecraft:golden_axe');
    event.add('forge:tools/cutting', 'minecraft:diamond_axe');
    event.add('forge:tools/cutting', 'immersiveengineering:axe_steel');
    event.add('forge:tools/cutting', 'notreepunching:iron_mattock');
    event.add('forge:tools/cutting', 'notreepunching:gold_mattock');
    event.add('forge:tools/cutting', 'notreepunching:diamond_mattock');
    event.add('forge:tools/cutting', 'notreepunching:netherite_mattock');
    event.add('forge:tools/cutting', 'farmersdelight:flint_knife');
    event.add('forge:tools/cutting', 'farmersdelight:iron_knife');
    event.add('forge:tools/cutting', 'farmersdelight:golden_knife');
    event.add('forge:tools/cutting', 'farmersdelight:diamond_knife');
    event.add('forge:tools/cutting', 'farmersdelight:netherite_knife');
    event.add('forge:tools/cutting', 'notreepunching:flint_knife');
    event.add('forge:tools/cutting', 'notreepunching:iron_knife');
    event.add('forge:tools/cutting', 'notreepunching:gold_knife');
    event.add('forge:tools/cutting', 'notreepunching:diamond_knife');
    event.add('forge:tools/cutting', 'notreepunching:netherite_knife');
});
#

thing is, in the recipe, only the first item in the tag, notreepunching:iron_saw can be used on the cutting board

#

@near kettle

near kettle
#

because youre wrapping it in Item.of()

#

unwrap it

#

Item.of() can only be an item, so it will select the first one from a tag

#

you dont need to wrap everything in it

#

get rid of all of them