- Java unknown block type
- Enum Constant Summary
- Field Summary
- Method Summary
- Methods inherited from class java.lang.Enum
- Methods inherited from class java.lang.Object
- Enum Constant Detail
- UNKNOWN
- TEXT
- TABLE
- PICTURE
- RULER
- BARCODE
- UNRECOGNIZED
- Field Detail
- UNKNOWN_VALUE
- TEXT_VALUE
- TABLE_VALUE
- PICTURE_VALUE
- RULER_VALUE
- BARCODE_VALUE
- Method Detail
- values
- valueOf
- getNumber
- valueOf
- forNumber
- internalGetValueMap
- getValueDescriptor
- getDescriptorForType
- getDescriptor
- valueOf
- How to Fix Errors in Worldgen Data Packs
- Video Guide
Java unknown block type
Enum Constant Summary
Field Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
static Block.BlockType | forNumber (int value) |
static Descriptors.EnumDescriptor | getDescriptor () |
Descriptors.EnumDescriptor | getDescriptorForType () |
int | getNumber () |
Descriptors.EnumValueDescriptor | getValueDescriptor () |
static Internal.EnumLiteMap | internalGetValueMap () |
static Block.BlockType | valueOf (Descriptors.EnumValueDescriptor desc) |
static Block.BlockType | valueOf (int value) |
Methods inherited from class java.lang.Enum
Methods inherited from class java.lang.Object
Enum Constant Detail
UNKNOWN
TEXT
TABLE
PICTURE
RULER
Horizontal/vertical line box.
BARCODE
UNRECOGNIZED
Field Detail
UNKNOWN_VALUE
public static final int UNKNOWN_VALUE
TEXT_VALUE
public static final int TEXT_VALUE
TABLE_VALUE
public static final int TABLE_VALUE
PICTURE_VALUE
public static final int PICTURE_VALUE
RULER_VALUE
public static final int RULER_VALUE
Horizontal/vertical line box.
BARCODE_VALUE
public static final int BARCODE_VALUE
Method Detail
values
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Block.BlockType c : Block.BlockType.values()) System.out.println(c);
valueOf
public static Block.BlockType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
getNumber
public final int getNumber()
valueOf
forNumber
internalGetValueMap
public static Internal.EnumLiteMapBlock.BlockType> internalGetValueMap()
getValueDescriptor
getDescriptorForType
getDescriptor
valueOf
public static Block.BlockType valueOf(Descriptors.EnumValueDescriptor desc)
How to Fix Errors in Worldgen Data Packs
This tutorial will go over how to look at the Minecraft output log and find the text relevant to whatever error you’re having, and then how to fix your world generation data pack depending on what you find there.
The error messages that this tutorial goes over are the ones that I have come across most often and all of the ones that I’ve helped people fix, so likely you’ll find what you need here, but if you find an error message that isn’t solved in this tutorial then comment it on the video linked above and I’ll add it to this tutorial!
Video Guide
This looks like a lot of text and might seem hard to understand, but the only part that’s helpful to you is the first three lines at the top.
Failed to validate datapack java.untill.concurrent.CompletionException:com.google.gson.JsonParseException: Error loading registry data: No key Properties in MapLike[]
The Failed to validate datapack part just tells what the error is – something is wrong with the data pack.
java.untill.concurrent.CompletionException: com.google.gson.JsonParseException tells what the nature of the error is, this isn’t very helpful to you because it doesn’t describe what the exact error is.
No key … in MapLike[…] (… because your error will be different depending on what went wrong) Tells you exactly what the error is. This is the most helpful part because it lets you know approximately where in your files the problem is. For example, if your error says
No key Properties in MapLike[], this means that somewhere in your files you told the game to generate a grass block, but didn’t specify what properties it should have.
Basically, all that this error means is that something is missing somewhere – I most commonly come across this in surface builder files but it could probably in any other file, however the Data-pack Helper Plus extension for VSCode that I mentioned above should catch most instances of this error. Here’s an example of the problem:
The first image is the code that generated the error, the second image is the corrected code, with the key Properties inserted into the curly bracket that contains “Name”:“minecraft:grass_block”.
Error loading registry data: Failed to parse …
Example:
Error loading registry data: Failed to parse frost:worldgen/configured_feature/feature.json file: com.google.gson.stream.MalformJsonException: Unterminated object at line 24 column 55 path $.config.decorator.type
Just like the last error, the helpful code is the first four lines at the top.
Failed to validate datapack java.untill.concurrent.CompletionException: com.google.gson.JsonParseException: Error loading registry data: Failed to parse frost:worldgen/configured_feature/feature.json file: com.google.gson.stream.MalformJsonException: Unterminated object at line 24 column 55 path $.config.decorator.type
The Failed to validate datapack part again just tells what the error is – something is wrong with the data pack.
java.untill.concurrent.CompletionException: com.google.gson.JsonParseException tells what the nature of the error is, this isn’t very helpful to you because it doesn’t describe what the exact error is.
Error loading registry data: Failed to parse frost:worldgen/configured_feature/feature.json file tells what file the error is in, in this case the file data/frost/worldgen/configured_feature/feature.json.
com.google.gson.stream.MalformJsonException goes into more detail on the nature of the error and what it is in more detail, but still isn’t super helpful.
Unterminated object at line 24 column 55 path $.config.decorator.type tells that the error is in the 24th line down from the top of the file and the 55th character from the left, which is inside the type parameter, in decorator, in the config parameter of the file.
What’s nice about this error in particular is that it tells you exactly where the problem is and it’s usually something pretty obvious, or something that Data-pack Helper Plus can catch.
You can see in this example along the top that the error is in data/frost/worldgen/configured_feature/feature, just like the error said it would be, and it’s located inside type inside decorator inside config, in that file.
The error, which is a number 1 that shouldn’t be there after “minecraft:water_depth_threshold”, is in line 24 as you can see by the line number on the left side of the code window, and it is the 55th character from the left of the window, although the only way to count that is manually since there isn’t a visual indicator. This is exactly what the error said, which makes it easy to find this error.
Error loading registry data: Missing value …
Example:
Error loading registry data: Missing value: ResourceKey[minecraft:worldgen/configured_surface_builder / frost:icy_wastes]
Just like the last three errors, the helpful code is the first three lines at the top.
Failed to validate datapack java.untill.concurrent.CompletionException: com.google.gson.JsonParseException: Error loading registry data: Missing value: ResourceKey[minecraft:worldgen/configured_surface_builder / frost:icy_wastes]
The Failed to validate datapack part again just tells what the error is – something is wrong with the data pack.
java.untill.concurrent.CompletionException: com.google.gson.JsonParseException tells what the nature of the error is, this isn’t very helpful to you because it doesn’t describe what the exact error is.
Error loading registry data: Missing value: ResourceKey[minecraft:worldgen/configured_surface_builder / frost:icy_wastes] tells what the error is – one of the files is looking for frost/worldgen/configured_surface_builder/icy_wastes, but this file does not exist.
This error occurs when you either name a file incorrectly or when you make a typo in a file that is referencing another file – in this case, one of the files is looking for a surface builder file that doesn’t exist.
Since the only file type that uses a surface builder is a biome file, you should easily be able to figure out which file is messed up in this case. If the name it gives is a misspelled version of another file, such as a feature, you know that the error is in one of your biomes that uses that feature.
You can see in the example picture above that on the right, the biome is looking for the frost:icy_wastes surface builder. However, on the left, you can see that the actual file that exists is called frost:icy_wastess, with an extra s on the end.
So, the file that the biome is looking for doesn’t exist, which is what generates this error.
java.lang.NullPointerException
Unlike the other errors listed here, there isn’t really any helpful code, but the first two lines tell you what went wrong.
Failed to validate datapack java.untill.concurrent.CompletionException: java.lang.NullPointerException
The Failed to validate datapack part again just tells what the error is – something is wrong with the data pack.
java.untill.concurrent.CompletionException: java.lang.NullPointerException tells what the nature of the error is, this isn’t very helpful to you because it doesn’t describe what the exact error is.
Even though this error message doesn’t help you to find where the error is, it still at least gives you a hint at what to look for. In my experience this means there’s a typo somewhere and it’s going to be pretty hard to catch, just look through your files and see if there are any typos that VSCode isn’t catching.
All of the times I have encountered this error are in a multi noise dimension file, specifically in the list of biomes to generate. For example, basalt_delta instead of basalt_deltas, and shattered_savana instead of shattered_savanna. This might actually be the only place that this error can occur, so check here first. If you’re not sure whether all your biomes are spelled correctly, you can go into a world that has cheats and do /locatebiome to find a list of the official names of all biomes.
Value … outside of range […]
Example:
Error reading worldgen settings after loading data packs: Value 4.0 outside of range [0.0:1.0]
Unlike the other errors listed here, this one isn’t a validation error and happens once the world is loaded.
Error reading worldgen settings after loading data packs: Value 4.0 outside of range [0.0:1.0]
All that this error is telling you is that somewhere in one of your files, you have a value that’s outside the allowed range, in this case, there’s a 4 where you’re only allowed to have a number between 0.0 and 1.0. The example image on the left shows that the offset parameter is set to 4, which is outside of the allowed range.
Because the error doesn’t really give any hints as to where in your data pack the error occurs, I suggest pressing Ctrl/Cmd + f to search for every instance of the number that the error is caused by (in this example, search for the number 4 to check where the error could be).
If you don’t know the accepted ranges, the official Minecraft wiki can help you find the ranges that the game will allow: here’s the page for dimensions and here’s the page for biomes.
Unknown block type ‘…’
Example:
Unknown block type ‘minecraft:’ at position 0
Unlike all the other errors on this list, this one will not be caught during data pack validation, and will actually crash your game.
Encountered an unexpected exception Z: Feature placement . Caused by: java.lang.RuntimeException: com.mojang.brigadier.exceptions.CommandSyntaxException: Unknown block type ‘minecraft:’ at position 0:
The Encountered an unexpected exception part just tells that something went wrong.
z: Feature placement tells that the problem happened during feature placement, so it’s something wrong with a configured feature or configured structure feature.
Caused: by java.RuntimeException: com.mojang.brigadier.exceptions.CommandSyntaxException tells what the nature of the error is, this isn’t very helpful to you because it doesn’t describe what the exact error is.Unknown block type ‘minecraft:’ at position 0 tells you exactly what the problem is, that the game doesn’t recognize a block somewhere.
In this example, Minecraft doesn’t recognize WafflesAreBetter is super cool as a valid block. I believe the reason that it says Unknown block type ‘minecraft:’ instead of Unknown block type ‘minecraft:WafflesAreBetter’ is that it doesn’t recognize capital letters.
Usually this will just be a random typo, I’ve only experienced this in jigsaw blocks inside of structure nbt files but it may also be possible for this error to be caused by files in the data pack, but I think that’s more likely to be a java.lang.NullPointerException error.
To find where the problem is, check all the jigsaw blocks that might have this misspelling. For example, if the problem is that you spelled netherrack with only one r (Unknown block type ‘minecraft:netherack’), then you only have to check the jigsaws that turn into netherrack, not ones that turn into any other block.