The bug:
The entity is moved up ~0.05 blocks (established using carpets mod's tick freeze) and becomes stuck in the piston head. On versions 1.2.1-1.19.4, when the piston is retracted, the entity clips into the piston body and sinks through the cobweb.
Expected Result:
The piston to push the entity up a full block and the entity to sink through the cobweb.
Steps to Reproduce:
Place piston, facing upwards
Place rail on top of piston
Place cobweb to the top and left of the piston
Place minecraft on the rail and break the rail
Nudge the minecart into the cobweb
Ensure there are no block underneath the cobweb
Power and de-power the piston (slowly)
See the video and photos for more information on how to setup this glitch.
Responses:
Now tested for all spawn egg mobs (in response to Marty Mcfly):
Doesn't affect Spiders / Cave spiders, as these mobs are not slowed by cobwebs.
Doesn't affect flying mobs (Bees, Bats, Ghasts, Phantoms) or mobs summoned with
/summon minecraft:creeper ~ ~ ~ {NoGravity:1b}
Now tested for short duration pulses (in response to Gnamf Jojo):
Works for all pulses, down to 0-tick pulses (make sure there's no block under the cobweb)
Updates:
When a player is pushed within the cobweb, they are put into swim mode.
This glitch also affects Minecarts that are still on rails.
Code analysis
Code analysis by @unknown can be found in this comment.
Related issues
Attachments
Comments



Can confirm.
Affects 21w05b

Can confirm.
Affects 21w05b

This seems to affect all entities.

This seems to affect all entities.

Agree. Affects all entities. Can reproduce. Does not work if using an impules to power piston

Agree. Affects all entities. Can reproduce. Does not work if using an impules to power piston
Can confirm in 21w13a.

Can confirm in Minecraft 1.19.4. It also affects powder snow (when moving horizontally) and sweet berry bushes.
Code analysis (Yarn mappings)
Cobwebs, powder snow, and sweet berry bushes use the Entity#slowMovement
method as well to affect movement. This method sets a multiplier field which is used to multiply the movement distance when the Entity#move
method is called. Typically, this allows a multiplier to be set for when the entity updates its position in the next tick.
However, additional movement can be applied from other sources, such as pistons and shulkers. In these cases, the movement multiplier affects the external source of movement rather than the entity's own movement.
To fix this issue, the Entity#move
method should simply check the MovementType
before applying the movement multiplier.

This behavior still exists in Minecraft snapshot 23w14a.

Can confirm in 24w45a.
This bug is related to this bug report too: MC-278182
It is crucial to fix this bug for proper, consistent behavior from item entities when moved by pistons
@unknown's bug solution would be valid, as explained here: MC-278255
Furthermore, powder snow can cause the same bug too (1.17+ as the block was introduced back then)

Can confirm in 24w45a.
This bug is related to this bug report too: MC-278182
It is crucial to fix this bug for proper, consistent behavior from item entities when moved by pistons
@unknown's bug solution would be valid, as explained here: MC-278255
Furthermore, powder snow can cause the same bug too (1.17+ as the block was introduced back then)