mojira.dev
MC-110748

Entity riders and their passengers can't be pushed by other entities and have no collision

When summoning entities with a passenger entity then the root entities won't collide with other root entities, and the passengers won't collide with other passengers. Entities pass through one another.
I expected entities to push/collide with each other.

EDIT: Noticed it's still in previous versions like 1.10.2 and 1.9.4, might be related to MC-15202 as in the fix for that one caused this.
EDIT2: Checked to make sure and the issue happens since 14w27a, it's not in the previous snapshot 14w26c, so that would actually point directly at changes done to fix MC-15202

Reproduce with these commands:

/summon minecraft:chicken ~ ~ ~ {Passengers:[{id:"cow"}]}
/summon minecraft:cow ~ ~ ~ {Passengers:[{id:"chicken"}]}

Linked issues

Attachments

Comments 23

Confirmed. It seems to me that mounted entities can push normal entities, but cannot be pushed.

Confirmed for 1.12.2 pre-2.

Confirmed for 1.12.2 release.

Confirmed for 17w43b.

13 more comments

Can confirm in 1.19 and 22w24a.

Can confirm in 1.19.2.

Can confirm in 1.21.10

Looks like this bug is being caused by this code inside of the push method of net/minecraft/world/entity/Entity:

if (!this.isVehicle() && this.isPushable()) {
  this.push(-xa, 0.0, -za);
}

if (!entity.isVehicle() && entity.isPushable()) {
  entity.push(xa, 0.0, za);
}

I assume that the isVehicle() checks were added in response to complaints like “I can’t ride my horse without bumping into my teleporting dogs”. Personally, I think it might be sufficient to only perform this check if the entity is being ridden or controlled directly by a player. So if an entity is not being ridden/controlled by a player, then the game should allow them to be pushed by other entities, even if they have passengers.

In other words, I’m suggesting that

!this.isVehicle()

Gets replaced with

(!this.isVehicle() || !(this.getControllingPassenger() instanceof Player))

And the same for the entity.isVehicle() bit a few lines later.

Maxaxik

(Unassigned)

Confirmed

Platform

Low

Mob behaviour

collision, passengers, riding-entities

Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12 Pre-Release 6, ..., 1.21, 1.21.1, 1.21.2 Pre-Release 4, 1.21.4, 25w10a

Retrieved