Changing NBT of dropped items

Started by BrownBear85 on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Sep 2021
Points:
493

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
Changing NBT of dropped items

I'm making an enchantment that makes dropped items not despawn and makes them invulnerable. I can't change NBT tags of the items, however. Is there a different block I should use?

Code: https://imgur.com/a/TYHWOM3

Active 3 years ago
Joined Sep 2017
Points:
703

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
Do something like this:…
Wed, 10/13/2021 - 07:13

Do something like this:

Execute command / "data merge entity @s {Invulnerable:1b,Age:-32000}" in the name of event/target entity

Active 4 months ago
Joined Jan 2023
Points:
317

User statistics:

  • Modifications: 0
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 68
Hey! When it is possible to…
Fri, 01/12/2024 - 20:15

Hey! When it is possible to manage dropped items, can you please help me with changing itemstack's NBT while it's dropped and i don't have the Entity given, only the Itemstack value.

Active 1 month ago
Joined Jul 2024
Points:
51

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 11
This is an issue I've run…
Fri, 03/21/2025 - 20:56

This is an issue I've run into as well, I really wish there was a "convert itemstack to entity" block for this reason alone. I guess an option would be to use the "Spawn dropped item at x y z pickup delay despawn" and then detect it as an entity using a "for each entity as entity iterator at x y z in square cube with size". But either way, the workaround is annoying.