Item that has been picked has extra NBT data after the mob has been killed.
SkippyTheLost opened this issue ยท 7 comments
I've noticed items that get picked up have extra NBT data, causing them to no longer stack with other items.
Specifically, the data is {Item:{tag:{Picked:1b}}}
.
Using the following command removes the extra data on all items on the ground, and allows the items to stack again:
/execute as @e[type=minecraft:item,nbt={Item:{tag:{Picked:1b}}}] run data remove entity @s Item.tag.Picked
Using Fabric 1.20.1 with v1.1.0
The data is removed before the entity despawns, can I get a list of the mods youre using it with and a confirmation if the tag is still there after the mob despawns?
hello! i'm also running into this issue. i'm using mod version 1.1.1 on Minecraft 1.20.1, Forge 47.1.0
there have been a few instances where i've noticed it happening; for example:
- i killed a vanilla spider, which dropped a piece of string. a vanilla husk picked up the string. i killed the husk and picked up the string. the string still has the Picked tag and does not stack with other string. this happens as well with rotten meat, etc.
- my tamed raccoon from Alex's Mobs regularly picks up items on the ground. once the items are retrieved from him by right-clicking, they have the Picked tag and do not stack with others.
- other mobs from Alex's Mobs that pick up items as part of their gimmick don't seem to cause this issue for some reason, namely crows and seagulls do not trigger the Picked tag.
i think Alex's Mobs and Respawning Animals are the only noteworthy mods we're using that would possibly interact with this, but i really have no idea. i'll attach the full modlist of the server just in case. thank you!
I'm having this issue with just Fabric API and letmedespawn-fabric-1.20-1.1.0.jar, in a vanilla mob grinder, so I get the loot, they die, tag still remains on item and won't stack.
@frikinjay The issue is that your mixin is only called when a mob despawns, not when it is killed for any other reason (player, etc), and that's the only spot in the code that removes the NBT tag (had to decompile because the v1.1.0 source code isn't uploaded to this repo):
@Redirect(method = "checkDespawn", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/MobEntity;discard()V"))