[SPIGOT-6243] SmithingRecipe ignores ItemMeta Created: 17/Nov/20  Updated: 21/Nov/20

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Tobias de Bruijn Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 1.16.4
Environment:
  • OS: Windows 10 Home
  • Minecraft version: 1.16.4

Attachments: PNG File img.png    
Version: git-Spigot-a19903d-4b33c74 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

It appears that SmithingRecipe ignores ItemMeta.

See the code example here: https://paste.md-5.net/qabajicuko.cs

In-game the item looses all it's NBT data, so the name I set in the item meta is lost. See screenshot in attachments

Expected behavior

Item gets the NBT data applied to the item stack when created.

 

Real behavior

Item looses it's NBT data when crafting



 Comments   
Comment by Tobias de Bruijn [ 21/Nov/20 ]

Gotcha. Thanks! If there's nothing more for you to do on this issue it can be closed I suppose then

Comment by md_5 [ 20/Nov/20 ]

You could use PrepareSmithingEvent.
As I said, the entire NBT will correspond to the input item's NBT.

Comment by Tobias de Bruijn [ 20/Nov/20 ]

Right. What would the appropriate work around be? Could I copy the NBT over manually? Question also is, how is the PersistentDataContainer handled? Also overriden?

Comment by md_5 [ 20/Nov/20 ]

Yes the problem is smithing copies the NBT from the elytra. This is vanilla behaviour which eg ensures that your enchants are preserved when you upgrade your item using netherite.

Generated at Sat Apr 05 09:53:45 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.