copyDataComponents on SmithingTransformRecipe is not working as intended
Expected behavior
According to javadocs, setting copyDataComponents parameter to false should prevent components to be copied from the base item, to the recipe result.
https://jd.papermc.io/paper/1.21.10/org/bukkit/inventory/SmithingTransformRecipe.html#%3Cinit%3E(org.bukkit.NamespacedKey,org.bukkit.inventory.ItemStack,org.bukkit.inventory.RecipeChoice,org.bukkit.inventory.RecipeChoice,org.bukkit.inventory.RecipeChoice,boolean)
Observed/Actual behavior
Setting this copyDataComponents to false makes no visible effect. Components from the base item are still copied to the recipe result.
Steps/models to reproduce
- Create and register new
SmithingTransformRecipe, wherecopyDataComponentsis set tofalse. - See that components from base item are still copied to the recipe result.
new SmithingTransformRecipe(NamespacedKey.fromString("example:diamond_pickaxe_from_smithing"), ItemStack.of(Material.DIAMOND_PICKAXE), RecipeChoice.empty(), new RecipeChoice.MaterialChoice(Material.IRON_PICKAXE), new RecipeChoice.MaterialChoice(Material.DIAMOND), false);
Plugin and Datapack List
none
Paper version
[22:09:32 INFO]: Checking version, please wait...
[22:09:32 INFO]: This server is running Paper version 1.21.10-108-main@97452e1 (2025-11-10T18:27:52Z) (Implementing API version 1.21.10-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.10-105-1f31ee5 (MC: 1.21.10)
Other
No response
1.20.4 - Vanilla copies result and applies nbt of input, the behaviour is correct https://github.com/PaperMC/Paper-archive/blob/9de3f75fa2af7c47dc2ed3bcec850b9e245dda21/patches/server/0612-Option-to-prevent-NBT-copy-in-smithing-recipes.patch#L31
1.20.6 - Vanilla copies input and applies components of the result, the resulting behaviour is incorrect https://github.com/PaperMC/Paper-archive/blob/a4f0f5ccd05592dc9be040d8c17d6795baa7b1b8/patches/server/0592-Option-to-prevent-data-components-copy-in-smithing-r.patch#L29
In both cases the copy of nbt/components are wrapped in if, but since the source of the nbt/components reversed the behaviour was broken