mojira.dev
MC-116489

Unknown entity property for entity_properties loot table condition causes server crash for default loot tables

The bug

Specifying an unknown entity property in the entity_properties loot table condition causes the server to crash if the affected loot tables replaces a default one. Minecraft (client) remains open but stays at the "Loading world" screen.

This probably affects previous versions as well, but I have not tested those.

[^crash-2017-04-20_23.51.40-server.txt]

Description: Exception in server tick loop

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: Unknown loot entity property 'minecraft:profession'
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2217)
	at com.google.common.cache.LocalCache.get(LocalCache.java:4154)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
	at bes.a(SourceFile:46)
	at bes.a(SourceFile:52)
	at bes.<init>(SourceFile:42)
	at nq.b(SourceFile:161)
	at cfz.a(SourceFile:98)
	at cfz.j(SourceFile:130)
	at net.minecraft.server.MinecraftServer.run(SourceFile:436)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Unknown loot entity property 'minecraft:profession'
	at bfp.a(SourceFile:33)
	at bfk$a.a(SourceFile:63)
	at bfk$a.b(SourceFile:41)
	at bfj$a.a(SourceFile:88)
	at bfj$a.deserialize(SourceFile:76)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
	at com.google.gson.Gson.fromJson(Gson.java:887)
	at com.google.gson.Gson.fromJson(Gson.java:952)
	at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162)
	at qf.a(SourceFile:437)
	at qf.a(SourceFile:453)
	at ben$a.a(SourceFile:76)
	at ben$a.deserialize(SourceFile:71)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
	at com.google.gson.Gson.fromJson(Gson.java:887)
	at com.google.gson.Gson.fromJson(Gson.java:952)
	at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162)
	at qf.a(SourceFile:437)
	at qf.a(SourceFile:453)
	at bep$a.a(SourceFile:119)
	at bep$a.deserialize(SourceFile:115)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.Gson.fromJson(Gson.java:887)
	at com.google.gson.Gson.fromJson(Gson.java:852)
	at com.google.gson.Gson.fromJson(Gson.java:801)
	at com.google.gson.Gson.fromJson(Gson.java:773)
	at bes$a.b(SourceFile:96)
	at bes$a.a(SourceFile:64)
	at bes$a.load(SourceFile:56)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211)
	... 12 more

How to reproduce

  1. Download the attached loot table

[media]
  1. and move it in the following directory of your world file

    data\loot_tables\minecraft\entities
  2. Open the world

Attachments

Comments 2

I change the summary to be more generic since it looks like it does not matter if a NBT tag with the same name exists. I hope you are fine with that

Makes sense to me. If the NBT tag / properties don't exist or the property is not exposed, the condition should always return false instead of crashing.

Now I would expect that if "entity_properties" had visibility to one tag (like "on_fire"), it would have access to them all, but that may be a feature request. Regardless a list of exposed tags should be made available (unless all are, of course).

Michael

Nathan Adams

Confirmed

entity_properties, lockup, loot-table

Minecraft 1.11.2, Minecraft 17w16a, Minecraft 17w16b

Minecraft 1.12 Pre-Release 6

Retrieved