CraftTweaker

CraftTweaker

151M Downloads

recipe functions for more than just crafting table recipes

TheKidThatCodes opened this issue ยท 1 comments

commented

Describe the feature you'd like

add a recipe function paramater to all vanilla recipe things

Describe alternatives you've considered

none

Additional context

for making enchantments carry over through smithing

Minecraft version

1.20.4

Modloader

Fabric

commented

This is not possible due to how certain machines in vanilla function, for example the Furnace, Blast Furnace and Smoker function like so:

ItemStack recipeOutput = recipe.value().getResultItem(registryAccess);
ItemStack outputSlot = inventory.get(2);
if (outputSlot.isEmpty()) {
    inventory.set(2, recipeOutput.copy());
} else if (outputSlot.is(recipeOutput.getItem())) {
    outputSlot.grow(1);
}

To explain, if the output slot is not empty, and it is the same Item (not stack with nbt or count, just base Item), then just grow the output by one.

This actually does introduce a bug currently, where if you have a furnace recipe that outputs 2 apples, the following happens:

  1. The first time you smelt it, you get 2 apples
  2. The second time it is smelted, you get 1 apple

Forge does fix that though, but Fabric does not.