Jump to content

Recommended Posts

Posted

Like the title said, I'm curious if there's a way for a recipe to completely use an item's durability regardless of what it is. I'm aware of the "toolDurabilityCost" function, but due to the spontaneity of the durability of player's items and the ridiculous amount of recipes required for each individual level of durability I figured asking around would be the best option. 

To clarify, I ideally want the recipe to consume the tool completely while only having a single output item. A single copper axe should not turn into 249 additional copper axe heads.

Also here's my in-progress code if anyone was curious:

Spoiler

[
    {
        "ingredientPattern": "B",
        "shapeless": true,
        "ingredients": {
            "B": {
                "type": "item",
                "code": "game:axe-felling-*",
                "isTool": true,
        toolDurabilityCost: "*", <--- (Tried using a wildcard here, no dice)
        "name": "metal",
        "returnedStack": { <--- (Unrelated, this also doesn't work for some reason) 
            "type": "item",
            "code": "game:stick",
            "quantity": 1
        }
            }
        },
        "width": 1,
        "height": 1,
        "output": {
            "type": "item",
            "code": "somedisassemblyrequired:oldtoolhead-axe-{metal}",
            "quantity": 1
        }
    }
]

 

Posted
1 hour ago, Wondiws98 said:

So basically have the tool disappear when used in the crafting grid? Just remove the line "isTool": true.

I can't believe I spent half an hour making a 26KB patch as a workaround for this and I could've removed a single line.

Thank you, I need to go take a break from coding for a little while.

  • Like 1
  • Haha 1
  • Cookie time 1
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.