mojira.dev
MC-106350

villages.dat that contains populated Players NBT tags spam IllegalArgumentException to console

If interacting with villagers in a village updates the Players NBT tag in villages.dat, two subtags are created: Int S and String UUID. S is given an integer value, and UUID is populated with the player's UUID.

If these subtags are loaded from the villages.dat file during gameplay, the game spams the following error to the console when attempting to save data to villages.dat:

java.lang.IllegalArgumentException: Name and ID cannot both be blank
	at com.mojang.authlib.GameProfile.<init>(GameProfile.java:25)
	at ml.a(SourceFile:81)
	at ml.a(SourceFile:140)
	at vv.b(SourceFile:455)
	at vx.b(SourceFile:228)
	at baj.a(SourceFile:92)
	at baj.a(SourceFile:78)
	at ls.a(SourceFile:927)
	at ls.a(SourceFile:879)
	at net.minecraft.server.MinecraftServer.a(SourceFile:372)
	at bzl.a(SourceFile:214)
	at bzl.C(SourceFile:145)
	at net.minecraft.server.MinecraftServer.run(SourceFile:458)
	at java.lang.Thread.run(Thread.java:745)

Deleting either the entire villages.dat file or the contents of the Players NBT tag from each villager corrects this problem, until player interaction populates the tag again.

This may be somehow related to the fix for MC-101325 Loading Village.dat containing player reputation causes NullPointerException

Linked issues

Comments 3

Matti Ruohonen

Yep this is because of a lazy non-fix for the issue MC-101325.

Instead of changing the Village class to use the player's UUID as a key in the playerReputation map, they made a lazy non-fix by just adding null checks for the world reference to the readVillageFromNBT() method to fix the crash that MC-101325 was about. Which means that due to the reasons I explained in a comment in that issue, the game still won't read the player reputation from NBT by the actual player name because that part of the code now doesn't run because of the null checks, and the world still being null at that point. So the player reputation is instead read from a tag called "Name" which doesn't exist. Which then leads to the GameProfile being created for a player called "" (empty string), and thus this exception and console spam.

Please fix this issue by using the player UUID instead of the player name as a key when storing player reputation in a village and get rid of the currently broken GameProfile stuff, which would need a world reference in the NBT read/write methods, which currently is not available at those times when the methods are called. Using the name also means that the reputation for a player (account) in a village will be lost if they change their username.

Still an issue in 1.12, just saying...

Uriel Salischiker

Is this still a issue in the latest version of the game(currently 1.13.1)?

If so, please add it to the affected versions, thanks!

Zed Ontargs

(Unassigned)

Community Consensus

Minecraft 1.10.2, Minecraft 1.12

Retrieved