How do I save the nbt of an entity in an Itemstack?

Started by SHORT on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I save the nbt of an entity in an Itemstack?

Basically, I’m identifying an item dropped on the ground and I want to work with it when the player picks it up and turns it into an item. To do that, I need to know exactly which item it is, so I assign an NBT tag for identification. The problem is that when the item is collected from the ground, it stops being an entity and becomes an ItemStack, losing all the information that was previously saved.

Because of this, I’m wondering: how can I do this?