mojira.dev
MC-97692

Boat riding on an entity riding on an entity

If you summon an entity with a passenger entity with a passenger boat like so:

/summon Zombie ~ ~ ~ {Passengers:[{id:"Zombie",Passengers:[{id:"Boat"}]}]}

Any server will crash if the first entity is able to sit in a boat. So for example if you use this command:

/summon Squid ~ ~ ~ {Passengers:[{id:"Zombie",Passengers:[{id:"Boat"}]}]}

It will not crash.

The only possible explanation I can think of is that the boat is trying to pull the lower entity on it, but because it's technically riding it, it can't. It's constantly trying to do this over and over again which causes the crash. The boat wont try to pull the entity it's riding on in however.


Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 13

Can you attach the crash report?

Unless crash reports have changed folder-location then no.

It is not the client that crashes. It's the server. You'll see, if you try it in singleplayer, that no server-sided actions will happen. Command don't work, items don't come when you break blocks, entities don't move, etc. The server logs aren't very helpful either. It just says: [Server thread/INFO]: [@: Object successfully summoned]

Before having this issue: Please force a crash by holding F3+C for 10 seconds and attach the resulting crash report here.

Please attach the server.log after having that issue.

3 more comments

Please link to this comment in the description

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason why this happens is because the boat picks up the lowest zombie. This creates an infinite riding cycle.
Something similar happens when two mobs with a boat as a passenger each collide. I do not know why their collision boxes intersect though.
The problem is that the method net.minecraft.entity.Entity.startRiding(Entity, boolean) does not test whether the entity it should ride is a passenger.

public boolean startRiding(Entity entityIn, boolean force)
{
    // Added this
    Entity entity;
    for (entity = entityIn; entity.isRiding(); entity = entity.getRidingEntity()) {
        if (this.equals(entity)) return false;
    }
    if (this.equals(entity)) return false;
    
    if (force || this.canBeRidden(entityIn) && entityIn.canFitPassenger(this))
    {
        if (this.isRiding())
        {
            this.dismountRidingEntity();
        }

        this.ridingEntity = entityIn;
        this.ridingEntity.addPassenger(this);
        return true;
    }
    else
    {
        return false;
    }
}

Still in 1.10-pre1

Hi, i found something strange, you have to try this on singleplayer 1.10.2: summon two zombies riding a boat and then, somehow, make them collide. what happens to me is the same has you, the game seems to stop responding, destroy blocks don't drop items, mobs don't move, buttons stay pressed, etc.

chokoboy3

migrated

Confirmed

Minecraft 1.9 Pre-Release 2, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, ..., Minecraft 1.10 Pre-Release 1, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b

Minecraft 16w42a

Retrieved