Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. 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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16.1, 1.16.2, 1.16.5, 21w14a, 1.18.1, 1.18.2, 1.19.2, 24w45a
    • Community Consensus
    • Entities

      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)
      

            Unassigned Unassigned
            sof sofia
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: