mojira.dev
MC-121379

Functions, advancements and loot tables allow other filetypes than .mcfunction and .json

I tried naming a function test.txt by forgetting to add the .mcfunction at the end, but the game still noticed the file. And because "txt" is 7 characters less than "mcfunction", the function name was cut off so it tried to load a function with a name length of less than 0 which caused an error.

Linked issues

Attachments

Comments 8

Can confirm:

[21:08:15] [Server thread/ERROR]: Couldn't read function luigis_mansion:rooms/nieuw tekstd from luigis_mansion:functions/rooms/nieuw tekstdocument.txt
java.io.FileNotFoundException: luigis_mansion:functions/rooms/nieuw tekstdocument.txt
        at qa.a(SourceFile:61) ~[minecraft_server.jar:?]
        at qf.a(SourceFile:59) ~[minecraft_server.jar:?]
        at nt.a(SourceFile:142) [minecraft_server.jar:?]
        at qf.c(SourceFile:121) [minecraft_server.jar:?]
        at qf.a(SourceFile:109) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.a(SourceFile:1369) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.aM(SourceFile:1352) [minecraft_server.jar:?]
        at da.a(SourceFile:31) [minecraft_server.jar:?]
        at bj.a(SourceFile:92) [minecraft_server.jar:?]
        at bj.a(SourceFile:70) [minecraft_server.jar:?]
        at pa.c(SourceFile:855) [minecraft_server.jar:?]
        at pa.a(SourceFile:842) [minecraft_server.jar:?]
        at la.a(SourceFile:37) [minecraft_server.jar:?]
        at la.a(SourceFile:9) [minecraft_server.jar:?]
        at hv$1.run(SourceFile:13) [minecraft_server.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131]
        at h.a(SourceFile:125) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.D(SourceFile:637) [minecraft_server.jar:?]
        at nz.D(SourceFile:349) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.C(SourceFile:593) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:497) [minecraft_server.jar:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]

Is this also the case for loot tables?

Yes. I've updated the title.

CreeperMagnet_

Please update this to the correct versions- this still affects 17w45b, and prevents all mac users from using functions at all.

As far as I can tell, the bug also affects the new 17w46a snapshot.

CreeperMagnet_

This seems to not apply to the new snapshot. Seems like they've indirectly fixed it. 🙂

EDIT: They only fixed this problem for functions. Loot tables, and advancements are still affected.

I still experience this bug in 17w47b with the filepath being data/(namespace)/functions/test.txt
If I use /reload it just comes up with the message String index out of range: -3 which is fine, but if I load up the map, the game crashes (Or rather it stops responding, which forces me to kill the process).

A proposed fix is to ignore files that don't have the necessary [a-z0-9/._-] format or correct file extension instead of stopping the entire datapack from being loaded or crashing the game.

Via MC-123516 appears to not be fixed for .DS_Store

chokoboy3

Nathan Adams

Confirmed

advancement, data-pack, file, function

Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47b, Minecraft 17w50a

Minecraft 17w47a, Minecraft 17w48a, Minecraft 18w01a

Retrieved