mojira.dev
MC-188328

Boats don't push non boat entities of which the bottom of the hitbox is higher than the bottom of the boat hitbox

When entities are on the edge of for example a trapdoor or slab, and their hitbox extends outside the trapdoor or slab and then you try to push the entity with a boat by riding it the entity doesn't get pushed, even though both hitboxes clearly collide. After looking in the code it clearly looks like a bug.

Code Analysis

(yarn mappings: net.minecraft.entity.vehicle boatEntity.java)

@Override
public void pushAwayFrom(Entity arg) {
    if (arg instanceof BoatEntity) {
        if (arg.getBoundingBox().minY < this.getBoundingBox().maxY) {
            super.pushAwayFrom(arg);
        }
    } else if (arg.getBoundingBox().minY <= this.getBoundingBox().minY) {
        super.pushAwayFrom(arg);
    }
}

As you can see when a boat and a non boat entity collide it only pushes the entity if the bottom of hitbox from the boat is on the same height, or higher than the bottom of the hitbox from the entity, as can bee seen in the following line:

else if (arg.getBoundingBox().minY <= this.getBoundingBox().minY)

This seems very unintntional and it would be very easily fixed by changing that line to

else if (arg.getBoundingBox().minY <= this.getBoundingBox().maxY)

Attachments

Comments 3

Still affects 1.18.1

Affects 24w45a. Also would like to request ownership to maintain the report.

Viktor40

sof

(Unassigned)

Community Consensus

Entities

Boats, entities

1.15.2, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16.1, 1.16.2, ..., 1.18.2, 1.19.2, 24w45a, 1.21.4, 1.21.8

Retrieved