#How to make tools consumable after crafting?

19 messages · Page 1 of 1 (latest)

gloomy sigil
#

I have crafting recipe that use Gregtech Tools. Most tools in the mod used for crafting and not being consumed fully. I found there .damageIngredient() to essentially consume a tool durability, but when I craft ALL tools disappear even when I specify: .damageIngredient('gtceu:bronze_' + tool, 9999).

tools.forEach(tool =>
    {
      event.shaped(
      Item.of('mekanismtools:bronze_' + tool, 1), // arg 1: output
      [
        'C D',
        'BAB', // arg 2: the shape (array of strings)
        '   '
      ],
      {
        A: 'gtceu:bronze_' + tool,
        B: '#forge:plates/bronze',  //arg 3: the mapping object
        C: '#gtceu:tools/crafting_hammers',
        D: '#gtceu:tools/crafting_files'
      }
    ).damageIngredient('gtceu:bronze_' + tool, 9999)
    })

Is there easy way to do it? Or why ALL tools get consumed in the crafting process? What I doing wrong?

dire topazBOT
#

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

frigid eagleBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:
Note that these are backticks, not apostrophes

```js :arrow_left:

ServerEvents.recipes(event => {
event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

This example will look like this:

ServerEvents.recipes(event => {
  event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
sonic ice
#

By default it uses up the entire item if you dont have damage ingredient

#

So rather than telling it to damage the bronze tool just tell it to keep the other two

#

That should work

gloomy sigil
#

It is not get used even without .damage. I think it is something with how GregTech tools are not consumed in crafting. I just didn't expect the mining tools to be affected.

sonic ice
#

Hmm?

#

What do you mean?

gloomy sigil
#

I mean that without .damageIngredient bronze tools were not consumed. I added it specificaly to try to count this problem, but now all other tools getting consumed.

#

So either I don't understand how this function filter work or maybe there a other way to tag item as consumable in this particular crafting recipe?

compact spade
#

what are the item id's?

#

I am pretty sure gregtech uses proper snake case, so .damageIngredient('gtceu:bronze' + tool, 9999) seems like it will just give an invalid item id

#

also, recipe modifiers can be a bit wonky with strings that get adjusted, I know that when I used .replaceIngredient() in a loop, it just started replacing all ingredients, a similair thing could be happening here

gloomy sigil
#

I will check and try fix later with this new info. But reciped worked before, but I will rechek.

gloomy sigil
#

Sorry for confusion. The lower cases get deleted by discord formating.

#
tools.forEach(tool =>
    {
      event.shaped(
      Item.of('mekanismtools:bronze_' + tool, 1), // arg 1: output
      [
        'C D',
        'BAB', // arg 2: the shape (array of strings)
        '   '
      ],
      {
        A: 'gtceu:bronze_' + tool,
        B: '#forge:plates/bronze',  //arg 3: the mapping object
        C: '#gtceu:tools/crafting_hammers',
        D: '#gtceu:tools/crafting_files'
      }
    ).damageIngredient('gtceu:bronze_' + tool, 9999)
    })
gloomy sigil
#

No, all tools still disappear