frikinjay / let-me-despawn

Seeks to improve performance in minecraft by tweaking mob despawn rules.
GNU Lesser General Public License v3.0
8 stars 1 forks source link

Item that has been picked has extra NBT data after the mob has been killed. #13

Closed SkippyTheLost closed 1 year ago

SkippyTheLost commented 1 year ago

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

frikinjay commented 1 year ago

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?

milkembers commented 1 year ago

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 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!

2023-07-10_21-40-19

RipleyHyena commented 1 year ago

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.

Kirisoup commented 1 year ago

Having the same issue here, but on quilt loader

Kevin-Marsh commented 1 year ago

Duplicated on Allthemods 9 forge 47.1.3 version letmedespawn-1.1.1.

LilyRose2798 commented 1 year ago

@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"))

frikinjay commented 1 year ago

I was away for a bit, fixed in 1.2.0