The Bug:
When a living entity is falling next to a berry bush and a cobweb, the block that has the higher position in certain axes will be the one to change the velocity multiplier. This can cause an entity to fall quicker thru a cobweb than it normally should. The block that has the slower velocity multiplier should take priority rather than by position. Watch video for a better example than the setup below.
Steps:
1) Create a world.
2) Create the following setup:
[media]3) Fall on the different sides to see how the velocity differs.
Code analysis:
Using Yarn mapping 1.16.3:
In the CobwebBlock, it used the entity.slowMovement method.
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
entity.slowMovement(state, new Vec3d(0.25, 0.05f, 0.25));
}
In the SweetBerryBushBlock, it uses the same thing.
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
//removed code
entity.slowMovement(state, new Vec3d(0.8f, 0.75, 0.8f));
//removed code
}
As they are both using the same call, the one that is called last will change the velocity.
Video:
Linked issues
duplicates 1
Attachments
Comments 7
@Galaxy_2Alex It works when the player block position is even over the cobweb, as can be done with anvils instead of wall block for alignment. (Just takes the values it finds last in collision)
We're resolving and linking this ticket forward as a duplicate of MC-262496, as that ticket contains more detailed information and/or has already been triaged by Mojang.
Isn't that MC-1133, or is the model still centered on the cobweb?