#dataconverter
1 messages · Page 1 of 1 (latest)
Vanilla does not add the waterlogged field, so DataConverter doesn't. In general, differences between Vanilla need to be explicitly commented. In what cases is this causing a problem?
ah, I see.
It is probably an issue almost only for me, as it breaks https://github.com/mircokroon/minecraft-world-downloader ability to get the correct blockstateid for leaves from worlds that are converted. This is due to minecraft --reports generation (https://github.com/mircokroon/minecraft-world-downloader/blob/master/src/main/java/game/data/registries/RegistryLoader.java#L135) returning blockstates with waterlogged property always present, and if it isnt present no id can be found and s...
I fixed it on my end, but it feels like a hack. Shouldn't the converter aim to convert as close to how a normal world would save its chunks?
Closing anyways, its not only with leaves, needs to be solved another way if it actually does need to be solved.
The method to read a BlockState from an NBT tag is to start with the default block state according to the Name field, and then to use StateHolder#setValue(Property, V) with all Properties in the NBT.
That's why it works, and it's been like that for a long while. So, if this does break Vanilla worlds in the future it will be a bug with their code to read the BlockStates from the NBT.
31c84ba Add subversion to DATA_COMPONENTS command conve... - Spottedleaf
0583383 Add CommandArgumentUpgrader (#11) - jpenilla
[PaperMC/DataConverter] branch deleted: commands
59e1a03 Correctly retrieve lists without checking type - Spottedleaf
e83959c Add null check for missing filtered pages - Spottedleaf
e169d13 Null check sign messages for command converter - Spottedleaf
7320289 Upgrade Component arguments - jpenilla
[PaperMC/DataConverter] New branch created: component-argument
03d0112 Correctly place custom_data into components - Spottedleaf
00c519f don't include the license in the jar twice (onc... - jpenilla
8fe3d88 Namespace target rename in V2100 - Spottedleaf
808d41d Upgrade Component arguments (#12) - jpenilla
[PaperMC/DataConverter] branch deleted: component-argument
f1920b8 Do not convert writable book text components fo... - Spottedleaf
df33c6b Add startup flag to disable command converter - Spottedleaf
Thank you GitHub. As always its very intuitive that forks automatically set head branches to the upstream.
[PaperMC/DataConverter] branch deleted: dev/1.20.5
Player Heads are used often in many servers and with the 1.20.5 changes player head names require it to be the same requirements as Minecraft Usernames. Any head that uses the skullowner name space that does not fit the username convention gets removed and just says 's Head`. This can be seen in this bug report. A conversion fix would be to convert heads that have...
Is it the best idea to put this here rather than in a later converter when the format has actually changed? I'm just thinking about if someone wants to use this to upgrade to a format older than 1.20.5. Or was this always supposed to be here?
- The old code was using
StringReader.peek()in a place where it meant to beStringReader.skip(). - The vanilla code allows a trailing comma, but only if there is no whitespace between it and the closing bracket, which is a bit weird. I think that's a bug and it shouldn't allow trailing commas, but if you disagree then only the first issue needs to be fixed.
42b5bf4 Fix minecraft:can_break instead of minecraft:ca... - Earthcomputer
26119d2 Fix data loss in container item component conve... - Earthcomputer
I have no way to test, but, the logic here looks more sound
It's because this converter is for the next snapshot, and this component was renamed and the format changed. You can see in the changelog.
- The old code used
getMapinstead ofgetGeneric. This would actually cause problems sincedimensionis a string in practice. - Changed
&&to||to match vanilla behaviour. Not as important as both should be set anyway.
a5e7e1b Fix ConverterParticleToNBT.parseProperties - Earthcomputer
I agree that this shouldn't be here, but unfortunately DFU does it this way.
DataConverter is not used to convert LEVEL, so there's not much fixing it would do.
3138743 Update to 1.20.5-pre2 - Spottedleaf
b4681be Update to 1.20.5-rc2 - Spottedleaf
8849493 Custom command converter - Spottedleaf
31c84ba Add subversion to DATA_COMPONENTS command conve... - Spottedleaf
0583383 Add CommandArgumentUpgrader (#11) - jpenilla
ce5e022 Add itemstack parsing - Spottedleaf
59e1a03 Correctly retrieve lists without checking type - Spottedleaf
e83959c Add null check for missing filtered pages - Spottedleaf
e169d13 Null check sign messages for command converter - Spottedleaf
[PaperMC/DataConverter] branch deleted: dev/1.20.6
611faee Use regular string tag visitor for output - kennytv
cf70346 Add conversion for summon command (#19) - jpenilla
[PaperMC/DataConverter] branch deleted: summon-command
If there is a command that places a hopper with items in it for example, the items won't be converted to the item component format.
I noticed this with this command:
`/setblock -39 30 707 minecraft:hopper[enabled=true,facing=east]{Items:[{Count:41b,Slot:0b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":true,"color":"gray"}]','[{"text":"ɾɛsρɪɾɑɫɪoп oпcɛ gɪνɛп ɫo ɫhɛ shɾɪпɛ","italic":true,"color":"gray"}]','[{"text":"ƅɛhɪпժ ɫhɛ ɛпժlɛss ɫᴜппɛl.","italic":true,"color":"gray"}]'],Name:'[{"text":"🌊","italic":false,"color":"aqua"},{"text":" "},{"text":"Λզ","bold":true},{"text":"ᴜɑ","bold":true,"color":"dark_aqua"},{"text":" ","bold":true},{"text":"Δᴜ","bold":true,"color":"blue"},{"text":"sɫ","bold":true,"color":"dark_blue"},{"text":" ","bold":false,"color":"dark_blue"},{"text":"🌊","bold":false,"color":"dark_blue"}]'}}},{Count:1b,Slot:1b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":t...
Close #20
Adds support for block state argument from set and fill commands
Example input:
/setblock -39 30 707 minecraft:hopper[enabled=true,facing=east]{Items:[{Count:41b,Slot:0b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":true,"color":"gray"}]','[{"text":"ɾɛsρɪɾɑɫɪoп oпcɛ gɪνɛп ɫo ɫhɛ shɾɪпɛ","italic":true,"color":"gray"}]','[{"text":"ƅɛhɪпժ ɫhɛ ɛпժlɛss ɫᴜппɛl.","italic":true,"color":"gray"}]'],Name:'[{"text":"🌊","italic":false,"color":"aqua"},{"text":" "},{"text":"Λզ","bold":true},{"text":"ᴜɑ","bold":true,"color":"dark_aqua"},{"text":" ","bold":true},{"text":"Δᴜ","bold":true,"color":"blue"},{"text":"sɫ","bold":true,"color":"dark_blue"},{"text":" ","bold":false,"color":"dark_blue"},{"text":"🌊","bold":false,"color":"dark_blue"}]'}}},{Count:1b,Slot:1b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":true,"color":"gray"}]','[{"text":"ɾɛsρɪɾɑɫɪoп oпcɛ gɪνɛп ɫo ɫhɛ shɾɪпɛ"...
Chests and trapped chests were ok, but looked into it and lots of blocks which could potentially have some upgradable data had different id from the block (beds and piston not, but thought to still include them so it would be complete), so I've autogenerated a switch statement to cover this for 1.20.4 blocks
But I think it's fixed now
Would you mind sharing the script used to generate it?
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
var regs = server.registryAccess();
var reg = regs.registryOrThrow(Registries.BLOCK_ENTITY_TYPE);
var blocks = regs.registryOrThrow(Registries.BLOCK);
var builder = new StringBuilder();
for (var entity : reg) {
var id = reg.getKey(entity);
for (var block : entity.validBlocks) {
if (!Objects.equals(id, blocks.getKey(block))) {
builder.append("\ncase \"").append(blocks.getKey(block)).append("\" -> \"").append(id).append('"').append(';');
}
}
}
System.out.println(builder);
});
with accessible field net/minecraft/world/level/block/entity/BlockEntityType validBlocks Ljava/util/Set; access widener, then used intellij's suggestions to group them
When upgrading a 1.8 world with fences, iron bars glass panes, etc, paper does not connect them except on chunk borders:
Vanilla seems to handle this fine:
For reference, the map itself can be found in https://github.com/PGMDev/Maps/tree/master/The Fenland (level.dat + region folder only)
The custom dimension type must have the min world height set to 0 and the max set to 256 (i.e through a datapack) in order for the conversion to work properly, as connecting fences is the responsibility of the post-processor which runs after chunks are loaded.
[PaperMC/DataConverter] New branch created: dev/1.21.2
[PaperMC/DataConverter] New branch created: dev/1.21.3
[PaperMC/DataConverter] branch deleted: dev/1.21.2
[PaperMC/DataConverter] branch deleted: dev/1.21.3
I don't see where our logic differs from Vanilla here. If the world doesn't have extended height, it should not have the UpgradeData offset.
I ended up being able to workaround the issue by adding my own data converter to the pipeline and manually modifying the dimension in the "__context" data key for the chunk, causing it not to shift anymore
c0460b9 Update to 1.21.4-pre1 - Spottedleaf
e008ced Update to 1.21.4-pre2 - Spottedleaf
4b00026 Update to 1.21.4 - Spottedleaf
fa4721f Fix missing diff to original lock converter - Spottedleaf
29840de Fix incorrect lit_total_time conversion - Spottedleaf
ddec433 Sync changes from Paper - Spottedleaf
[PaperMC/DataConverter] branch deleted: dev/1.21.4
In 1.20.5 Mojang also changed how extra data is specified for particles that need them. For example:
/particle minecraft:block netherrack -309 27.6 860 1 1 7 0.1 230
should become
/particle minecraft:block{block_state:"minecraft:netherrack"} -309 27.6 860 1 1 7 0.1 230
Currently this conversion does not take place. I know this is technically not an "item component" related change, but it would still be nice to have conversion for this.
I think we were aware of the particle command but realised that in order to properly handle it we would need to parse the arguments and modify the entire command string - something we determined at the time that required too much work for too little gain. You will have to convert these ones by hand.
Is there any way I could speed up the manual conversion process? I have an old world with hunderts of command blocks. Like can I somehow search through all of them and find the ones that have a /particle command? Or maybe just log errors from command blocks along with the respective location?
I'm not aware of anything to speed up the process.
[PaperMC/DataConverter] branch deleted: dev/1.21.5
The logic attempts to parse the string representation of components for the flattening in 1.21.5.
In the below example, the component {"text":"",extra:["Hello\\n\\nthere"]} is parsed in an initial step into a NBTMapType.
This parsing however is not only top level, it also parses the entire extra array into a List and JsonPrimitive.
The single string component is then once again attempted to be "flattened" eventho it and its siblings were fully parsed from json in the initial parsing. This leads to a plain string being passed to the JsonParser, which promptly dies if the string does not comply with the json specs for an unquoted string literal (e.g. \n in the middle of a string)
1.21.4 itemstack /give @p written_book[written_book_content={title:"",author:"",pages:['{"text":"",extra:["Hello\\n\\nthere"]}']}] 1
[ca.spottedleaf.dataconverter.minecraft.versions.V4290] Failed to convert json to nbt: Hello
there
com.google.gson.JsonSyntaxException: com.google.gson.stream.Mal```...
0782df7 Update to 1.21.5 - Spottedleaf
6080b78 Correctly return String for NBTMapType#getGeneric - Spottedleaf
de6df7f Review walkers for TEXT_COMPONENT - Spottedleaf
bf355a2 Update to 1.21.6-pre1 - Spottedleaf
57a3e21 Finish review/testing - Spottedleaf
1ea8b5f Update to 1.21.6-pre2 - Spottedleaf
b388a85 Update to 1.21.6-RC1 - Spottedleaf
142ec80 Update to 1.21.6 - Spottedleaf...
[PaperMC/DataConverter] branch deleted: dev/1.21.6
Exception when upgrading 1.21.4 world on latest paper server.
Repro
Server must be run with --forceUpgrade for some reason.
repro.zip
Paper version
This server is running Paper version 1.21.6-DEV-HEAD@d7510ef (1970-01-01T00:00:00Z) (Implementing API version 1.21.6-R0.1-SNAPSHOT)
Stacktrace
[09:08:36 ERROR]: [ca.spottedleaf.dataconverter.minecraft.versions.V4290] Failed to convert json to nbt: Tricky Tracks
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setStrictness(Strictness.LENIENT) to accept malformed JSON at line 1 column 9 path $
See https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json
at com.google.gson.JsonParser.parseReader(JsonParser.java:116) ~[gson-2.11.0.jar:?]
at com.google.gson.JsonParser.parseString(JsonParser.java:92) ~[gson-2.11.0.jar:?]
at ca.spottedleaf.dataconverter.minecraft.versions.V4290$1.convert(V4290.java:235) ~[paper-1.21.6.jar:1.21.6-DEV-d7510ef]```...
Stack trace
Plugin and Datapack List
Paper Plugins (4):
CraftBook5, HuskHomes, LiteEco
Bukkit Plugins (31):
ChunkSpawnerLimiter, Chunky, ColoredSigns, CommandBook, DiscordSRV, FarmControl, FlyingCarpet, LogBlock, LogBlockQuestioner, LuckPerms, LWC, mcMMO, Multiverse-Core, Multiverse-Portals, OpenInv, ProtocolLib, QuickShop-Hikari, RedstoneClockDetector, SignRewards, TitleManager, VanishNoPacket, Vault, VaultChatFormatter, ViaVersion, Votifier, WorldBorder, WorldEdit, WorldGuard, ZHorse
Actions to reproduce (if known)
No response
Paper version
This server is running Paper version 1.21.6-46-main@35b2c6e (2025-06-26T18:53:41Z) (Implementing API version 1.21.6-R0.1-SNAPSHOT)
Other
I haven't done force-upgrade recently. Not sure when last but it should be a few major versions ago.
All DataConverter is doing here is logging, I don't see how it crashed anything.
I need data to look at this further, but just by looking at the logs it looks like it just encountered invalid data. I don't think any of these would have loaded on 1.21.4.
Thank you for looking into! I'm sorry its not a crash, its only display when there is a crash by 3rd parties.
I seem to be having a similar issue when upgrading from 1.21.1 -> 1.21.8 latest paper.
I also tried 1.21.1 -> 1.21.4 -> 1.21.8
Here is the log: https://mclo.gs/E128mNZ
Is there anything I can do in the interim? The server doesn't crash, but the error spams infinitely.
Issue 12873 on the PaperMC/Paper github was created. These errors make reading the console almost impossible during boot and whenever a player's inventory is read that has a problematic item.
It looks like bug #25 is related as well.
Old stats files (likely from before the flattening?) don't seem to load properly.
A message like [18:17:02 WARN]: Invalid statistic in ./helloclan/stats/16b85949-5c9a-4611-b4b7-d70074984149.json: Don't know what minecraft:276 is (which might be from some plugin? but I replicated the general error on a clean server) pops up in console, and the stats file fails to load.
See that file for example:
16b85949-5c9a-4611-b4b7-d70074984149.json
Can reproduce a similar error by:
- putting that file in your
world/statsfolder - Copying some player data file and giving it that UUID as its name
- Loading these stats, I used Debuggery with
dserver getOfflinePlayer(UUID) 16b85949-5c9a-4611-b4b7-d70074984149 getStatistic(Statistic) PLAY_ONE_MINUTE
Tested on latest 1.21.8 Paper:
> version
[00:44:44 INFO]: Checking version, please wait...
[00:44:45 INFO]: This server is running Paper version 1.21.8-22-main@bf465e0 (2025-08-03T15:29:10Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)
You are runnin```...
I see the same thing. Most of my player files that are being flagged are from players that haven't joined in over 6 years.
(as in, please open a mojira issue)
We don't handle stat files, so this is a DFU problem.
But isn't that what stuff like https://github.com/PaperMC/DataConverter/blob/d8b0a5467b6486d9677323dbbcf23356e45de4d2/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1451.java#L291-L309 is doing? or do you mean that's just unused right now?
We have all of the structure walkers and converters in place to run on STATS files but we don't because I really didn't feel like doing all of the testing necessary on top of the maintenance for it. Really it's just there to prove a point that the complexity in DFU is unnecessary.
Related Mojira issue created (reproduced separately): https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-305352
Running a paper server. An item dropped on the ground from before 1.13 (so say 1.12.2). When loaded the following error is logged into the console.
chunk@[-1488, 1166]:
[1]: Failed to decode value '"ellisbrewer"' from field 'Thrower': Not a list```
Item entities used to store the Thrower as a player name. Then on the 1.12 -> 1.13 update, they started storing as UUID L/M version. Though, searching the code, I cannot find a datafixer that dropped the old data.
https://minecraft.wiki/w/Java_Edition_1.13#:~:text=in%20each%20compound.-,thrower,-and
Then in the 1.15.2 -> 1.16 update. They convert the UUID L/M to the array of 4 Ints. (Data converter 2514)
https://minecraft.wiki/w/Java_Edition_1.16#:~:text=now%20much%20darker.-,uuids,...
In V4658.java - current line 118: convertInt(gameRules, "minecartMaxSpeed", "minecraft:max_minecart_speed"); There is a (correct) data converter for the experimental gamerule max_minecart_speed. Since it is only experimental, most servers do not even have this value set yet.
https://github.com/PaperMC/DataConverter/blob/c0a465e1eb785d1b348d4e4b3fc46ed6c64433ca/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4658.java#L118C17-L118C91
The problem is that the convertInt method sets an empty string as the value
https://github.com/PaperMC/DataConverter/blob/c0a465e1eb785d1b348d4e4b3fc46ed6c64433ca/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4658.java#L48
Causing the following server error log when loading a world that does not have this gamerule set in its world files.
[22:09:35 WARN]: Not a number missed input: {"minecraft:max_minecart_speed":""}
Inspecting the level.dat prior to running it through a 1.21.11 server shows that this gamerule was never se...
The original problem is actually whether the field was set. You should adjust all of the convert functions so that they avoid writing any value unless the original field is present.
This looks correct to me, although I do want to wait a bit and see how Mojang responds.
I can make that adjustment. 👍 I would agree
Noting that the Mojang issue was closed as "Won't Fix".
https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-305352
There was no further commentary on it. My take, is that non-essential conversion errors that 'just' result in one-time console spam is not considered worth dev time for such old versions. And I don't necessarily blame them for that perspective (if that is it).
The other possibility, is the desire to "keep" that invalid data around as long as possible, since they or 3rd parties that want to inject and save that data to a different location, instead of just throwing it away. Why change it to be discarded, when someone might want the data to stick around. (But it is getting discarded right now anyway...)
I am running the patch on our server and it tested fine when recreating the issue. Doesn't matter to me one way or the other whether this PR is merged. The only difference is no console errors; no data integrity is necessarily improved.
Noting the following as a follow-up. This Pull Request does have one flaw.
The error will still occur if a chunk was loaded after the DataVersion 2514, but loaded on a version before the codecs that make this error so strict.
chunk@[-1282, 1142][0]: Failed to decode value '"ellisbrewer"' from field 'Thrower': Not a list```
(the same error as before). When loading up that chunk before the latest loading, it shows to have been loaded in Minecraft version 1.19.2 (Data Version 3120).
So the "Proper" fix of cleaning up this data - is actually to remove this non-list of integers in a NEW or more new datafixer. Not necessarily the original fixer that messed things up.
As of right now, I am satisfied enough with the current state of my change. Acknowledging it does have a flaw...
Advise if anything in particular is desired on this....
Yeah I am fine with this as-is.
dcde1f1 Remove old name Thrower data for converted item en... - chickeneer