1

How do i make a .mcfunction file?[1.12]

noplsno 6/3/17 4:28 pm
11.3k
6/5/2017 12:30 pm
how do i make a .mcfunction file? i renamed my "brixjump" text document to "brixjump.mcfunction" but it doesn't work. what do i do?
also, i'm playing 1.12.
Posted by
noplsno
Level 2 : Apprentice Explorer
2

  Have something to say?

JoinSign in

9

Bertiecrafter
06/05/2017 12:30 pm
Level 72 : Legendary System
PepijnJust to provide an example (always make things more clear IMO).

A function located at:
\saves\WORLDNAME\data\functions\custom\example\new\test.mcfunction
can be 'called' using:
custom:example/new/test

A function located at:
\saves\WORLDNAME\data\functions\Pepijn\code.mcfunction
can be 'called' using:
custom:Pepijn/code

The names and amount of 'sub folders' are totally arbitrary (as long as you have at least one folder, because you need a namespace) but you should try to make your namespace something that other people are unlikely to use (in case others players want to use multiple functions from different creators)


The generic example was right, the last one is off. Your namespace is Pepijn there, not custom. (The function isn't located in a "custom" folder). You don't have to have a subfolder in the namespace.

So in the above example, you call the function using: /function Pepijn:code
1
noplsno
06/05/2017 9:33 am
Level 2 : Apprentice Explorer
thanks!
it's working, but i want to include a resource pack with the world.
where do i put my "resources.zip" folder? i've already done the textures.
1
Pepijn
06/05/2017 9:46 am
Level 58 : Grandmaster Cyborg
Directly inside the world folder. So "\saves\WORLDNAME\resources.zip".
1
Pepijn
06/04/2017 1:41 pm
Level 58 : Grandmaster Cyborg
Just to provide an example (always make things more clear IMO).

A function located at:
\saves\WORLDNAME\data\functions\custom\example\new\test.mcfunction
can be 'called' using:
custom:example/new/test

A function located at:
\saves\WORLDNAME\data\functions\Pepijn\code.mcfunction
can be 'called' using:
Pepijn:code

The names and amount of 'sub folders' are totally arbitrary (as long as you have at least one folder, because you need a namespace) but you should try to make your namespace something that other people are unlikely to use (in case others players want to use multiple functions from different creators)
1
Bertiecrafter
06/04/2017 1:31 pm
Level 72 : Legendary System
you put the function file in <world>/data/functions/<namespace>/

A namespace is a folder you can come up with yourself. Use your username, the creations name or something else fun.

Then in-game do /reload
and execute it once by doing /function <namespace>:<name>, where the name is the filename without ".mcfunction". You can execute it multiple times by putting the command on a redstone clock, 20 times a second in a purple command block that's always active OR 20 times a second by doing /gamerule gameLoopFunction <namespace>:<name>.
1
noplsno
06/04/2017 10:43 am
Level 2 : Apprentice Explorer
how do i load a function? i tried putting it in a folder in my functions in data, a folder within that folder, and by itself, but it can't locate it. is it something with the command automatically putting minecraft: before it?
1
sleeping
06/04/2017 8:28 am
Level 1 : New Explorer
-snip-
1
Bertiecrafter
06/04/2017 7:39 am
Level 72 : Legendary System
Inside your text editor, click "Save As..."
Then enter the filename "brixjump.mcfunction", now click the dropdown menu under the filename textbox and select "All Files (*.*)". After all that, hit Save.

".mcfunction" is an extension, it tells software what kind of file it is. For example, ".docx" is for word files, ".jpg" is for images. There are multiple extensions for word files and images and there are plenty of other types of files.

Selecting "All Files (*.*)" will prevent the text editor from adding another extension, overwriting ".mcfunction" in front.


Alternatively, you can uncheck "Hide extensions for known file types" in the "Display" tab of folder options or explorer options in config panel. I have a dutch pc, so I don't know the exact names of everything I just said. But once all file extensions are visible, you can hit rename on the file and rewrite the extension yourself.
1
sleeping
06/03/2017 4:38 pm
Level 1 : New Explorer
Honestly, I don't know what they are 'coz im a noob but... Try to redownload Minecraft (make sure everything is saved first!) and see of that works. Alternitivley, try naming the file what it was b4. Hope this helped!
1

Welcome