Mojira Archive
MC-138768

Crash when dolphins try to chase a boat with a non-living entity as passenger

The Bug

When a dolphin tries to chase a boat that has a non-living entity as primary passenger, the game will crash.

Steps to reproduce

  1. summon a boat with a non-living passenger (/summon minecraft:boat ~ ~ ~ {Passengers:[id:"minecraft:minecart"]})
  2. summon a dolphin (/summon minecraft:dolphin)

Code Analysis

(Fabric 1.14.4 build 12 names)
This happens, because the ChaseBoatGoal's canStart method dolphins are using does apply an unchecked cast to the boat's primary passenger to LivingEntity.

Crash Report

---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!

Time: 8/17/19 9:10 PM
Description: Ticking entity

java.lang.ClassCastException: axy cannot be cast to aix
	at amy.a(SourceFile:36)
	at aot.a(SourceFile:22)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at anf.a(SourceFile:69)
	at aiy.dc(SourceFile:623)
	at aix.k(SourceFile:2266)
	at aiy.k(SourceFile:487)
	at aix.h(SourceFile:2111)
	at aiy.h(SourceFile:294)
	at arf.h(SourceFile:259)
	at vk.a(SourceFile:583)
	at bhr.a(SourceFile:675)
	at vk.a(SourceFile:386)
	at net.minecraft.server.MinecraftServer.b(SourceFile:835)
	at net.minecraft.server.MinecraftServer.a(SourceFile:774)
	at eac.a(SourceFile:128)
	at net.minecraft.server.MinecraftServer.run(SourceFile:642)
	at java.lang.Thread.run(Thread.java:745)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at amy.a(SourceFile:36)
	at aot.a(SourceFile:22)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at anf.a(SourceFile:69)
	at aiy.dc(SourceFile:623)
	at aix.k(SourceFile:2266)
	at aiy.k(SourceFile:487)
	at aix.h(SourceFile:2111)
	at aiy.h(SourceFile:294)
	at arf.h(SourceFile:259)
	at vk.a(SourceFile:583)

-- Entity being ticked --
Details:
	Entity Type: minecraft:dolphin (arf)
	Entity ID: 33576
	Entity Name: Dolphin
	Entity's Exact location: 115.68, 58.67, 127.43
	Entity's Block location: World: (115,58,127), Chunk: (at 3,3,15 in 7,7; contains blocks 112,0,112 to 127,255,127), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Entity's Momentum: -0.20, 0.04, 0.00
	Entity's Passengers: []
	Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
	at bhr.a(SourceFile:675)
	at vk.a(SourceFile:386)

-- Affected level --
Details:
	All players: 1 total; [vl['RangerA2002'/152, l='The Mechanic', x=101.15, y=75.00, z=130.71]]
	Chunk stats: ServerChunkCache: 2944
	Level dimension: minecraft:overworld
	Level name: The Mechanic
	Level seed: 1796384663999514417
	Level generator: ID 00 - default, ver 1. Features enabled: true
	Level generator options: {}
	Level spawn location: World: (32,70,240), Chunk: (at 0,4,0 in 2,15; contains blocks 32,0,240 to 47,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 1621646 game time, 2004472 day time
	Level storage version: 0x04ABD - Anvil
	Level weather: Rain time: 67258 (now: false), thunder time: 31241 (now: false)
	Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
	at net.minecraft.server.MinecraftServer.b(SourceFile:835)
	at net.minecraft.server.MinecraftServer.a(SourceFile:774)
	at eac.a(SourceFile:128)
	at net.minecraft.server.MinecraftServer.run(SourceFile:642)
	at java.lang.Thread.run(Thread.java:745)

-- System Details --
Details:
	Minecraft Version: 1.14.4
	Minecraft Version ID: 1.14.4
	Operating System: Mac OS X (x86_64) version 10.14.5
	Java Version: 1.8.0_74, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 749095400 bytes (714 MB) / 2013265920 bytes (1920 MB) up to 2147483648 bytes (2048 MB)
	CPUs: 4
	JVM Flags: 8 total; -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	Player Count: 1 / 8; [vl['RangerA2002'/152, l='The Mechanic', x=101.15, y=75.00, z=130.71]]
	Data Packs: vanilla, file/multitool 1.5.1a (incompatible), file/Cargo Boats 1.0 (incompatible)
	Type: Integrated Server (map_client.txt)
	Is Modded: Probably not. Jar signature remains and both client + server brands are untouched.

Fixed

Matthew James Riley

[Mojang] Cory Scheviak

2018-11-03, 01:06 AM

2024-01-29, 03:02 PM

2019-11-12, 12:45 PM

6

6

Confirmed

Very Important

Crash, Mob behaviour

crash

Minecraft 1.13.2 - 19w40aMinecraft 1.13.2, Minecraft 18w44a, Minecraft 19w14a, 1.14.4, 19w40a

19w46a