[1.20.1] `/give` command drops extra item
andriihorpenko opened this issue ยท 1 comments
Base information
- Minecraft version: 1.20.1
- Mod version: 3.1.2.588
- Minecraft Forge version: 47.3.10
- Mod Pack: (if applicable)
Description / steps to reproduce
So this bug is quite amusing. This is a combination of shenanigans done by Forge/Mojang, and Draconic Evolution.
Whenever you /give
yourself a tool, chestpiece, capacitor or dislocator - an extra item will drop on the ground and will be unpickable. I've done quite some investigation on what's happening, so here's a walkthrough:
- Call
/give
command first adds an item to player's inventory. - If it was successfully added, Forge fires
ItemTossEvent
event, which in turn creates and spawnsItemEntity
in the world. - After the
ItemEntity
is spawned, the/give
command callsItemEntity#makeFakeItem
, which forcesItemEntity
to be unpickable and be immediately discarded. - Now as every DE tool, chestpiece and other items have
onEntityItemUpdate
overridden, they callItemEntity#setExtendedLifetime
. This line makes prior fake item never disappear from the world. And, as previously mentioned, it cannot be picked up.