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

Some feature configurations don't load in a datapack (java.lang.IllegalArgumentException: value already present: clh@77f95e19)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 20w30a
    • 20w28a, 20w29a
    • None
    • Community Consensus
    • Custom Worlds, World generation
    • Low

      The Bug

      Features that are defined in a certain way cause the datapack to be unable to be applied.
      In case the faulty feature is wrapped into for example another feature of type minecraft:decorated, you won't actually see any errors, as the inner feature seems to default to no_op in that case.
      If and only if the outer feature errors, you actually see the error.

      Some vanilla files from this dump are affected as well: https://twitter.com/slicedlime/status/1280893773296422912

      This is the exception, that shows up:

      java.lang.IllegalArgumentException: value already present: clh@77f95e19
      	at com.google.common.collect.HashBiMap.put(HashBiMap.java:287)
      	at com.google.common.collect.HashBiMap.put(HashBiMap.java:262)
      	at gh.a(SourceFile:64)
      	at gh.a(SourceFile:75)
      	at yb.b(SourceFile:66)
      	at yb$$Lambda$3899/603200739.apply(Unknown Source)
      	at com.mojang.datafixers.util.Pair.mapFirst(Pair.java:64)
      	at yb.a(SourceFile:65)
      	at yb$$Lambda$3898/1042558830.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.mapBoth(Either.java:33)
      	at com.mojang.serialization.DataResult.map(DataResult.java:110)
      	at yb.a(SourceFile:65)
      	at ya.decode(SourceFile:36)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$3.decode(RecordCodecBuilder.java:248)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.MapDecoder$4.decode(MapDecoder.java:94)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.lambda$null$1(KeyDispatchCodec.java:67)
      	at com.mojang.serialization.codecs.KeyDispatchCodec$$Lambda$3844/965811562.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.lambda$decode$2(KeyDispatchCodec.java:58)
      	at com.mojang.serialization.codecs.KeyDispatchCodec$$Lambda$3843/709506664.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.decode(KeyDispatchCodec.java:56)
      	at com.mojang.serialization.MapCodec$3.decode(MapCodec.java:186)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at yb.a(SourceFile:161)
      	at yb.a(SourceFile:139)
      	at yb.a(SourceFile:74)
      	at ya.decode(SourceFile:36)
      	at com.mojang.serialization.codecs.ListCodec.lambda$null$2(ListCodec.java:46)
      	at com.mojang.serialization.codecs.ListCodec$$Lambda$2996/136037594.accept(Unknown Source)
      	at com.mojang.serialization.JsonOps.lambda$getList$7(JsonOps.java:292)
      	at com.mojang.serialization.JsonOps$$Lambda$3872/198941055.accept(Unknown Source)
      	at com.mojang.serialization.codecs.ListCodec.lambda$decode$4(ListCodec.java:45)
      	at com.mojang.serialization.codecs.ListCodec$$Lambda$2995/1792087378.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.ListCodec.decode(ListCodec.java:39)
      	at com.mojang.serialization.Decoder$3.decode(Decoder.java:77)
      	at com.mojang.serialization.Codec$2.decode(Codec.java:71)
      	at com.mojang.serialization.codecs.ListCodec.lambda$null$2(ListCodec.java:46)
      	at com.mojang.serialization.codecs.ListCodec$$Lambda$2996/136037594.accept(Unknown Source)
      	at com.mojang.serialization.JsonOps.lambda$getList$7(JsonOps.java:292)
      	at com.mojang.serialization.JsonOps$$Lambda$3872/198941055.accept(Unknown Source)
      	at com.mojang.serialization.codecs.ListCodec.lambda$decode$4(ListCodec.java:45)
      	at com.mojang.serialization.codecs.ListCodec$$Lambda$2995/1792087378.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.ListCodec.decode(ListCodec.java:39)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$7.decode(RecordCodecBuilder.java:409)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$7.decode(RecordCodecBuilder.java:405)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at yb.a(SourceFile:161)
      	at yb.a(SourceFile:139)
      	at yb.a(SourceFile:74)
      	at ya.decode(SourceFile:36)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.MapDecoder$4.decode(MapDecoder.java:94)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.MapCodec$2.decode(MapCodec.java:63)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.lambda$null$1(KeyDispatchCodec.java:67)
      	at com.mojang.serialization.codecs.KeyDispatchCodec$$Lambda$3844/965811562.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.lambda$decode$2(KeyDispatchCodec.java:58)
      	at com.mojang.serialization.codecs.KeyDispatchCodec$$Lambda$3843/709506664.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.decode(KeyDispatchCodec.java:56)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$5.decode(RecordCodecBuilder.java:323)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.lambda$null$1(KeyDispatchCodec.java:67)
      	at com.mojang.serialization.codecs.KeyDispatchCodec$$Lambda$3844/965811562.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.lambda$decode$2(KeyDispatchCodec.java:58)
      	at com.mojang.serialization.codecs.KeyDispatchCodec$$Lambda$3843/709506664.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.KeyDispatchCodec.decode(KeyDispatchCodec.java:56)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$3.decode(RecordCodecBuilder.java:249)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.BaseMapCodec.lambda$decode$2(BaseMapCodec.java:31)
      	at com.mojang.serialization.codecs.BaseMapCodec$$Lambda$3836/1071236571.apply(Unknown Source)
      	at java.util.stream.ReduceOps$1ReducingSink.accept(ReduceOps.java:80)
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      	at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1540)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:484)
      	at com.mojang.serialization.codecs.BaseMapCodec.decode(BaseMapCodec.java:27)
      	at com.mojang.serialization.codecs.UnboundedMapCodec.lambda$decode$0(UnboundedMapCodec.java:38)
      	at com.mojang.serialization.codecs.UnboundedMapCodec$$Lambda$3834/849241856.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.codecs.UnboundedMapCodec.decode(UnboundedMapCodec.java:38)
      	at com.mojang.serialization.Decoder$2.decode(Decoder.java:63)
      	at com.mojang.serialization.Codec$2.decode(Codec.java:71)
      	at xz.decode(SourceFile:34)
      	at com.mojang.serialization.Decoder$2.decode(Decoder.java:63)
      	at com.mojang.serialization.Codec$2.decode(Codec.java:71)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:18)
      	at com.mojang.serialization.codecs.FieldDecoder.decode(FieldDecoder.java:29)
      	at com.mojang.serialization.MapCodec$1.decode(MapCodec.java:34)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$5.decode(RecordCodecBuilder.java:324)
      	at com.mojang.serialization.codecs.RecordCodecBuilder$2.decode(RecordCodecBuilder.java:107)
      	at com.mojang.serialization.MapDecoder.lambda$compressedDecode$0(MapDecoder.java:52)
      	at com.mojang.serialization.MapDecoder$$Lambda$2993/543433178.apply(Unknown Source)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.serialization.DataResult$$Lambda$632/2136614370.apply(Unknown Source)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.serialization.MapDecoder.compressedDecode(MapDecoder.java:52)
      	at com.mojang.serialization.MapCodec$MapCodecCodec.decode(MapCodec.java:91)
      	at com.mojang.serialization.Decoder$1.decode(Decoder.java:49)
      	at com.mojang.serialization.Codec$2.decode(Codec.java:71)
      	at com.mojang.serialization.Decoder.decode(Decoder.java:22)
      	at com.mojang.serialization.Decoder.parse(Decoder.java:26)
      	at dar.a(SourceFile:115)
      	at dar.a(SourceFile:206)
      	at dar$$Lambda$3828/715497518.apply(Unknown Source)
      	at dar.a(SourceFile:169)
      	at dar.a(SourceFile:57)
      	at dar$a.a(SourceFile:323)
      	at dmk.a(SourceFile:1683)
      	at dmk$$Lambda$3144/1074078310.apply(Unknown Source)
      	at dmk.a(SourceFile:1906)
      	at dmk.a(SourceFile:1753)
      	at dmk.a(SourceFile:1697)
      	at duq$a.e(SourceFile:411)
      	at duq$a.a(SourceFile:321)
      	at duq$a.a(SourceFile:258)
      	at dnr.a(SourceFile:331)
      	at dor.a(SourceFile:27)
      	at dml.b(SourceFile:92)
      	at dml$$Lambda$2888/1388124035.run(Unknown Source)
      	at drd.a(SourceFile:431)
      	at dml.a(SourceFile:92)
      	at dml.c(SourceFile:162)
      	at dml$$Lambda$2887/66554485.run(Unknown Source)
      	at aqp.execute(SourceFile:94)
      	at dml.b(SourceFile:162)
      	at dml$$Lambda$2238/1027992087.invoke(Unknown Source)
      	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
      	at org.lwjgl.system.JNI.invokeV(Native Method)
      	at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3174)
      	at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(SourceFile:127)
      	at dmk.e(SourceFile:1043)
      	at dmk.e(SourceFile:653)
      	at net.minecraft.client.main.Main.main(SourceFile:215)
      

      How to Reproduce

      I am not sure about the exact conditions. One example seems to be when a minecraft:random_selector is nested into a minecraft:decorated feature.

      For testing I attached a datapack with a minimal custom biome that still reproduces this bug.

      1. click "create new world"
      2. In the world creation screen, click "Data Packs"
      3. Drag crash_biome.zip onto the screen that you just opened opened.
      4. Enable the pack by clicking the arrow, moving it to the "Selected" column
      5. Go back to the world creation screen
        The game freezes on "Validating selected data packs", and the exception posted above appears in the log.

      Analyses

      Responsible is the buggy:crash_trees feature which is defined as follows:

      {
      	"name": "minecraft:decorated",
      	"config": {
      		"decorator": {
      			"name": "minecraft:decorated",
      			"config": {
      				"outer": {
      					"name": "minecraft:square",
      					"config": {}
      				},
      				"inner": {
      					"name": "minecraft:heightmap",
      					"config": {}
      				}
      			}
      		},
      		"feature": {
      			"name": "minecraft:random_selector",
      			"config": {
      				"default": "minecraft:oak",
      				"features": [
      					{
      						"feature": "minecraft:fancy_oak",
      						"chance": 0.1
      					}
      				]
      			}
      		}
      	}
      }
      

      If the decorator is ommited, the random_selector feature works as expected:

      {
      	"name": "minecraft:random_selector",
      	"config": {
      		"default": "minecraft:oak",
      		"features": [
      			{
      				"feature": "minecraft:fancy_oak",
      				"chance": 0.1
      			}
      		]
      	}
      }
      

      The outer decorated feature works as expected too, when using a different inner feature:

      {
      	"name": "minecraft:decorated",
      	"config": {
      		"decorator": {
      			"name": "minecraft:decorated",
      			"config": {
      				"outer": {
      					"name": "minecraft:square",
      					"config": {}
      				},
      				"inner": {
      					"name": "minecraft:heightmap",
      					"config": {}
      				}
      			}
      		},
      		"feature": "minecraft:oak"
      	}
      }
      

      The combination of the two, however, does not work for some reason.

            slicedlime [Mojang] slicedlime
            Schortan [Mod] NeunEinser
            Votes:
            18 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: