Custom Entity Items don't set pickup delay, lifetime
Random832 opened this issue ยท 5 comments
Describe the bug
Items with custom item entities only copy the position when replacing a vanilla item entity, not other properties like pickup delay, lifetime, owner, thrower. This leads to unusual behavior [items are picked up too quickly when thrown, the /give command creates a second item which is thrown away from the player]
How to reproduce the bug
- throw a singularity on the ground, it is picked up very quickly
- /give yourself a singularity, a second singularity is created and thrown on the ground
Expected behavior
- standard pickup delay for thrown items
- no extra singularity
Additional details
No response
Which minecraft version are you using?
1.19
On which mod loaders does it happen?
Forge
Crash log
https://gist.github.com/Random832/7cc7e5c1ece312e0d0700eaf831d8d81
I've done the same thing in the past and have been told the recommended practice on Forge is to copy all properties of the so-called "location" ItemEntity into the custom entity rather than using it strictly for location [arguably Forge should provide a helper function to do so, and rename the misleading parameter name, but it's solvable now regardless]
Just tested, the behavior is the same on fabric too (reasonable, since the problem is in the properties of the custom entity, not how it is added to the world). Solution is probably also the same.
Fixed by #6692 which removed custom item entities.