The Bug:
Unlike other mob entities, environmental damage deals extra damage to items, boats, and minecarts causing them to disappear instantly instead of a few seconds.
To Reproduce:
1. Throw an item onto a cactus.
2. Summon a chicken on a cactus.
Results:
Although items have more health than a chicken, they disappear quicker than the chicken.
Code Analysis:
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 1
Comments 11
Just look at the history of the report next time. (And if that seems inactive, check the user's activity feed.)
I just wanted to clarify that there are considerable implications for this bug depending on how it's fixed.
If this fix is just adding the invulnerability timer to items boats and minecarts then only items will be affected as boats and minecarts don't utilise the traditional health system. This is mostly a good thing as it means your items won't instantly evaporate when they touch cactus and blast chambers that utilise multiple TNT explosions in quick succession won't be as inefficient. A negative for this type of change would be that box yeeters, a device that uses cacti to quickly break open shulker boxes, will be affected as the shulker boxes will take longer to break and will get stuck in unintended positions. Instead lava could be used but this
BUT if this fix is one where health is added to carts and boats AND then the invulnerability timer is added then a vast majority of all contraptions that utlise carts and boats will be adversely affected. For example portal loaders will be come laggier as the minecarts will take longer to die and loaders that use boats will become unreliable as the extra time boats take to be destroyed will allow time for entities to ride in them and break the device. Cart yeeters, the new fruitful 1.19 tech, where a minecart is broken instantly to drop its contents and the cart item, will break as the additional time the cart takes to die will mean that the items sprawl out from an unintended position.
this is a feature request. there is 0 indication that the behaviour of boats,carts ,items should be the same as living entities nor is anything funny in the code happening... items,carts,boats etc are not the same as a creeper
https://feedback.minecraft.net/hc/en-us
Players and mobs use a timer to count down the next time they can take damage as described here called
invulnerableTime
. Which means that non-mob entities don't take more damage, but take damage every tick instead of every 10 ticks. Interestingly, the fieldinvulnerableTime
is available in theEntity
class, so all that needs to be done is to take the logic from players/mobs and apply it to the other entities.