Skip to content

Tall Cardboard Box Issues. #1841

Description

@Foxyas

Entities inside of such boxes can still be hit by melee attacks if they hitbox is big enough.

my suggestion is to make a mixin in "Entity$isPickable" to make any entity "riding" in a invisible "seatEntity" be immune of the melee hitpoint;

@Override
public boolean isPickable() {
    // Prevents crosshairs, melee attacks, and raycasts from targeting the entity
    return !(this.getVehicle() instanceof SeatEntity) && super.isPickable();
}

@Override
public boolean canBeCollidedWith() {
    // Stops other entities/players from pushing or colliding into the entity
    return !(this.getVehicle() instanceof SeatEntity) && super.canBeCollidedWith();
}

@Override
public boolean canBeHitByProjectile() {
    // Lets arrows and projectiles pass straight through without hitting a bounding box
    return !(this.getVehicle() instanceof SeatEntity) && super.canBeHitByProjectile();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions