mojira.dev
MC-122746

Some Functions do not work.

After searching for a solution to my issue and not finding anything on it, figured it was time to make a report.

I created a function in the file location: "Kingdom/Minecraft/world/data/functions/test/brown_cow.mcfunction"

The contents are as follows:

say How
say Now
say Brown
say Cow

I reloaded the game and ran it successfully using the "/function test:brown_cow" command.

I tried creating a serious function after testing the above one successfully under the following path:
"Kingdom/Minecraft/world/data/functions/tracker/time.mcfunction"

The contents are as follows:

scoreboard players add @a[score_ticks_min=1200] Minutes 1

scoreboard players remove @a[score_ticks_min=1200] ticks 1200

scoreboard players add @a[score_Minutes_min=60] Hours 1

scoreboard players remove @a[score_Minutes_min=60] Minutes 60

scoreboard players add @a[score_Hours_min=24] Days 1

scoreboard players remove @a[score_Hours_min=24] Hours 24

scoreboard players add @a[score_Days_min=30] Months 1

scoreboard players remove @a[score_Days_min=30] Days 30

scoreboard players add @a[score_Months_min=12] Years 1

scoreboard players remove @a[score_Months_min=12] Months 12

I reloaded the game and tried running it using the "/function tracker:time" command.
All I get when trying to run this new function is "Unknown function 'tracker:time'"

I created both functions using the same methodology. One worked, the other did not. Why is this?

Attachments

Comments 18

Hi, unfortunately this issue is invalid because you are running a modded server. If you can reproduce this in vanilla, let me know and I'll reopen it.

One thing that might help is checking the log when reloading. Errors in your function that prevent it from loading will be shown, if any.

Tested in single player vanilla 1.12.2.

File Path:
"AppData\Roaming\.minecraft\saves\functions\data\functions"

Typed /reload

/function test:brown_cow still works
/function tracker:time still does not work.

[media]

Copying your commands into a new function located at .minecraft\saves\New World\data\functions\tracker\time.mcfunction caused it to load up successfully for me and run as expected. Can you attach your function file?

[media]

How strange! lol

I created the time.mcfunction by opening brown_cow.mcfunction and editing it and saving as the new function... could that cause the issue?

I created a new function file from scratch. Saved it as time.mcfunction with UTF-8 encoding. Still does not work.

It baffles me that test:brown_cow works but tracker:time shows up as being unknown.

I tried another function "/function teams:score_clear" and it is also not being seen by the game. Contents of this function are as follows:

scoreboard players reset * Red
scoreboard players reset * Blue
scoreboard players reset * Green
scoreboard players reset * Yellow
scoreboard players reset * LoneWolf

8 more comments

Yes, I made sure to save it without BOM in Notepad ++

I fixed it!!!

1. I opened the file up in Notepad++
2. I CONVERTED the file to UTF-8 without BOM (this step was key. without this step, it would not work.)
3. I made sure it would encode the file as UTF-8 without BOM
4. I saved the file under all types under the name "time.mcfunction"
5. Reloaded game and it worked!

What I think happened is that I created brown_cow.mcfunction successfully in regular notepad, using UTF-8 without BOM.

When I created time.mcfunction, I did it by modifying brown_cow.mcfunction and editing the contents to save as time.mcfunction. I think what happened is that I did not realize that the encoding would change back to ANSI in "save as...". I think that is what happened?

Either way, I have fixed the issue!

Thank you for your time and help! Kinda a picky little system, those functions! 😛

Either way, I am glad the feature exists as it can make many great things happen for my custom server using commands!

I think that if you encode it as ANSI first, if you do not convert it to UTF-8 but save it as UTF-8 it still won't work proper. Converting made all the difference.

Ah, nice. Glad you were able to get it worked out! Take care. 🙂

Nikolas

(Unassigned)

Unconfirmed

Minecraft 1.12.2

Retrieved