mojira.dev
MC-120962

Functions don't work if UTF-8 file is encoded with a BOM

How To Fix This Bug:
If you are experiencing this bug, it might be because your UTF-8 encoded file is encoded with a BOM. To fix this, I downloaded Notepad++, and from the top bar, clicked Encoding > Encode in UTF-8.

[media]


Special thanks to @unknown and @unknown for their help.

Original Bug Report:
So I was playing on one of my worlds that uses a lot of chain command blocks, when I heard about functions. Naturally, I wanted to try them out. I was able to get one of my chain commands to work, but for some reason, others don't the game seems to arbitrarily decide which functions to recognize. I always used /reload to load any changes I made, I always used UTF-8 encoding, and like I said earlier, I got one of my chain commands to work. However, some of my commands don't work, and I have no clue why. I have included the functions I have tried to use and screenshots of them working (or not) to help aid in this bug fixing. Thanks!

Edit:
After looking at the log file (thanks @unknown), the error appeared to be that the mcfunction reader didn't believe that "execute" or "tellraw" were valid commands.

Linked issues

Attachments

Comments 5

Please attach the client log file (can be seen if you turn it on in the launcher settings).

I uploaded it as image-2017-10-03-15-33-01-689.png.

Don't know for sure, but the issue might be that Notepad adds a special invisible charactar in the beginning of the file which screws everything up. Maybe try another editor?

As the log shows, there’s something wrong with the files, make sure the encoding is UTF-8 without BOM, and make sure that there’s no hidden characters.

EDIT: ^ that too.

Oh! The problem was it was encoded with UTF-8 with BOM. I used Notepad++ to do UTF-8 without BOM and it worked fine. Thanks guys!

Andrew H

(Unassigned)

Unconfirmed

Minecraft 1.12.2

Retrieved