Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-145686

java.util.NoSuchElementException ticking entity crash when a workstation is destroyed immediately after a villager within a 1-block radius has taken the job matching the workstation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 19w14a
    • Minecraft 19w11a, Minecraft 19w11b, Minecraft 19w12b, Minecraft 19w13a, Minecraft 19w13b
    • Confirmed
    • Crash, Village system

      Setup
      Go into creative mode and have a workstation (tested with stonecutter and cartography table) and a villager spawn egg in your inventory. Place workstation first and then spawn villager (or vice versa) and wait for it to change its texture (meaning it has taken a job) and immediately thereafter destroy the block.

      All my tests had the villager within a one-block radius of the workstation.

      Expectation
      The game doesn't crash, but instead causes the villager to stop working at that station as it no longer exists.

      Observation
      The game crashes with a ticking entity crash described as java.util.NoSuchElementException.

      Crash log (attached as well - crash-2019-03-28_15.32.10-server.txt )

      19w13a: crash-2019-03-28_15.32.10-server.txt
      ---- Minecraft Crash Report ----
      // Daisy, daisy...
      
      Time: 13-3-19 17:23
      Description: Ticking entity
      
      java.util.NoSuchElementException: No value present
      	at java.util.Optional.get(Optional.java:135)
      	at akn.c(SourceFile:54)
      	at akn.g(SourceFile:17)
      	at ajk.e(SourceFile:43)
      	at ajk$$Lambda$2795/893830713.test(Unknown Source)
      	at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
      	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
      	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      	at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
      	at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449)
      	at ajk.g(SourceFile:43)
      	at ajf.c(SourceFile:52)
      	at aiu.b(SourceFile:185)
      	at aiu$$Lambda$2793/540347566.accept(Unknown Source)
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
      	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.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
      	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
      	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1612)
      	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
      	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
      	at java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2893)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      	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 aiu.a(SourceFile:185)
      	at atz.K(SourceFile:229)
      	at aig.cW(SourceFile:622)
      	at aif.k(SourceFile:2202)
      	at aig.k(SourceFile:478)
      	at ahu.k(SourceFile:141)
      	at aif.h(SourceFile:2051)
      	at aig.h(SourceFile:292)
      	at vc.a(SourceFile:579)
      	at vc$$Lambda$2634/1560289409.accept(Unknown Source)
      	at bfy.a(SourceFile:668)
      	at vc.a(SourceFile:382)
      	at net.minecraft.server.MinecraftServer.b(SourceFile:814)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:753)
      	at dwc.a(SourceFile:128)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:628)
      	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 java.util.Optional.get(Optional.java:135)
      	at akn.c(SourceFile:54)
      	at akn.g(SourceFile:17)
      	at ajk.e(SourceFile:43)
      	at ajk$$Lambda$2795/893830713.test(Unknown Source)
      	at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
      	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
      	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      	at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
      	at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449)
      	at ajk.g(SourceFile:43)
      	at ajf.c(SourceFile:52)
      	at aiu.b(SourceFile:185)
      	at aiu$$Lambda$2793/540347566.accept(Unknown Source)
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
      	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.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
      	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
      	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1612)
      	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
      	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
      	at java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2893)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      	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 aiu.a(SourceFile:185)
      	at atz.K(SourceFile:229)
      	at aig.cW(SourceFile:622)
      	at aif.k(SourceFile:2202)
      	at aig.k(SourceFile:478)
      	at ahu.k(SourceFile:141)
      	at aif.h(SourceFile:2051)
      	at aig.h(SourceFile:292)
      	at vc.a(SourceFile:579)
      	at vc$$Lambda$2634/1560289409.accept(Unknown Source)
      
      -- Entity being ticked --
      Details:
      	Entity Type: minecraft:villager (atz)
      	Entity ID: 165834
      	Entity Name: Dorpeling
      	Entity's Exact location: -90.50, 56.00, -87.50
      	Entity's Block location: World: (-91,56,-88), Chunk: (at 5,3,8 in -6,-6; contains blocks -96,0,-96 to -81,255,-81), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
      	Entity's Momentum: 0.00, -0.08, 0.00
      	Entity's Passengers: []
      	Entity's Vehicle: ~~ERROR~~ NullPointerException: null
      Stacktrace:
      	at bfy.a(SourceFile:668)
      	at vc.a(SourceFile:382)
      
      -- Affected level --
      Details:
      	Level name: Testing
      	All players: 1 total; [vd['DarkShadow_TNT'/3, l='Testing', x=-90.54, y=57.42, z=-85.66]]
      	Chunk stats: ServerChunkCache: 2535
      	Level seed: 2253500656129032334
      	Level generator: ID 01 - flat, ver 0. Features enabled: true
      	Level generator options: {biome:"minecraft:desert",layers:[{block:"minecraft:bedrock",height:1b},{block:"minecraft:stone",height:3b},{block:"minecraft:sandstone",height:52b}],structures:{}}
      	Level spawn location: World: (8,55,8), Chunk: (at 8,3,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
      	Level time: 151541 game time, 6000 day time
      	Level dimension: 0
      	Level storage version: 0x04ABD - Anvil
      	Level weather: Rain time: 17599 (now: false), thunder time: 8364 (now: false)
      	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
      Stacktrace:
      	at net.minecraft.server.MinecraftServer.b(SourceFile:814)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:753)
      	at dwc.a(SourceFile:128)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:628)
      	at java.lang.Thread.run(Thread.java:745)
      
      -- System Details --
      Details:
      	Minecraft Version: 19w11a
      	Operating System: Windows 10 (amd64) version 10.0
      	Java Version: 1.8.0_51, Oracle Corporation
      	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
      	Memory: 989206528 bytes (943 MB) / 1946157056 bytes (1856 MB) up to 2147483648 bytes (2048 MB)
      	JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
      	Player Count: 1 / 8; [vd['DarkShadow_TNT'/3, l='Testing', x=-90.54, y=57.42, z=-85.66]]
      	Data Packs: vanilla
      	Type: Integrated Server (map_client.txt)
      	Is Modded: Probably not. Jar signature remains and both client + server brands are untouched.
      

      Log (anonimised and attached as well - 2019-03-28-4.log)

      19w13a: 2019-03-28-4.log
      [15:32:10] [Server thread/ERROR]: Encountered an unexpected exception
      m: Ticking entity
      	at net.minecraft.server.MinecraftServer.b(SourceFile:820) ~[19w13a.jar:?]
      	at net.minecraft.server.MinecraftServer.a(SourceFile:755) ~[19w13a.jar:?]
      	at dwo.a(SourceFile:128) ~[19w13a.jar:?]
      	at net.minecraft.server.MinecraftServer.run(SourceFile:630) [19w13a.jar:?]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
      Caused by: java.util.NoSuchElementException: No value present
      	at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_51]
      	at alj.c(SourceFile:72) ~[19w13a.jar:?]
      	at alj.g(SourceFile:22) ~[19w13a.jar:?]
      	at ajq.c(SourceFile:45) ~[19w13a.jar:?]
      	at ajq$$Lambda$2871/903543169.test(Unknown Source) ~[?:?]
      	at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_51]
      	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[?:1.8.0_51]
      	at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:1.8.0_51]
      	at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449) ~[?:1.8.0_51]
      	at ajq.g(SourceFile:45) ~[19w13a.jar:?]
      	at ajj.c(SourceFile:61) ~[19w13a.jar:?]
      	at aix.a(SourceFile:285) ~[19w13a.jar:?]
      	at aix$$Lambda$2869/1951457415.accept(Unknown Source) ~[?:?]
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_51]
      	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_51]
      	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270) ~[?:1.8.0_51]
      	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1612) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270) ~[?:1.8.0_51]
      	at java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2893) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[?:1.8.0_51]
      	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_51]
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_51]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_51]
      	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_51]
      	at aix.e(SourceFile:285) ~[19w13a.jar:?]
      	at aix.a(SourceFile:233) ~[19w13a.jar:?]
      	at auz.K(SourceFile:254) ~[19w13a.jar:?]
      	at aij.cX(SourceFile:623) ~[19w13a.jar:?]
      	at aii.k(SourceFile:2206) ~[19w13a.jar:?]
      	at aij.k(SourceFile:479) ~[19w13a.jar:?]
      	at ahx.k(SourceFile:141) ~[19w13a.jar:?]
      	at aii.h(SourceFile:2051) ~[19w13a.jar:?]
      	at aij.h(SourceFile:293) ~[19w13a.jar:?]
      	at ve.a(SourceFile:581) ~[19w13a.jar:?]
      	at ve$$Lambda$2709/1546971920.accept(Unknown Source) ~[?:?]
      	at bgv.a(SourceFile:668) ~[19w13a.jar:?]
      	at ve.a(SourceFile:384) ~[19w13a.jar:?]
      	at net.minecraft.server.MinecraftServer.b(SourceFile:816) ~[19w13a.jar:?]
      	... 4 more
      

            hkniberg hkniberg
            DarkShadow_TNT DarkShadow_TNT
            Votes:
            12 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: