1
I've been trying to make a datapack that keeps running a command, i put it in a tick.mcfunction file but it only works when I run the cmd "/function (namespace):tick" the load functions works when i reload tho so idk what to do
13
Functions named "tick.mcfunction" will not run by themselves. You need to enlist the use of the "tick.json" function tag. In addition to what you already have, make sure the following path exists:
Once you have that, add a file named "tick.json" inside that path you just created(It MUST be tick.json, or it won't work). Now put the following inside and save the file:
Hope this helps! :)
DATAPACKNAME/data/minecraft/tags/functions/Once you have that, add a file named "tick.json" inside that path you just created(It MUST be tick.json, or it won't work). Now put the following inside and save the file:
{"values": ["NAMESPACE:PATH/TO/FILE"]}NOTE: "NAMESPACE:PATH/TO/FILE" should be updated with whatever file you are using.Hope this helps! :)
Can you please explain the "path to file" part, i dont really understand, cuz in my tick.json it says
{ "values": ["trash:tick"]}
{ "values": ["trash:tick"]}
The function looks like it should work…
But maybe your datapack isnt called „trash“ if you „link“ trash in the tick function your datapack also needs to be named „trash“
But maybe your datapack isnt called „trash“ if you „link“ trash in the tick function your datapack also needs to be named „trash“
Only the namespace folder needs to be named "trash". The actual folder that contains the "pack.mcmeta" file, and data folder, can be named anything and should continue to work fine regardless.
Ye i am a bit bad at explaining lol
wdym by that? do i rename the pack FOLDER?
if you open the datapack there is the „data“ folder right?
In it there is a „minecraft“ and a „namespace“ folder the „namespace“ folder should have the same name as the thing in the minecraft/tags/functions/tick.json
example: you name the „namespace“ folder „test“ then your tick.json will have to look like this: { "values": ["test:tick"]}
In it there is a „minecraft“ and a „namespace“ folder the „namespace“ folder should have the same name as the thing in the minecraft/tags/functions/tick.json
example: you name the „namespace“ folder „test“ then your tick.json will have to look like this: { "values": ["test:tick"]}
well i already did that, ty tho
if u want to check it out heres the download folder www.mediafire.com/folder/scy8de0cp7w23/MyPack
if u want to check it out heres the download folder www.mediafire.com/folder/scy8de0cp7w23/MyPack
This looks correct. What does your folder structure look like? Are you sure that tick.json is in the correct location, and are you sure that tick.mcfunction is located in the following directory?
If so, can you provide me with a download to your datapack so I can give it a look? I will try to pinpoint the problem.
DATAPACKNAME:data/trash/functions/tick.mcfunctionIf so, can you provide me with a download to your datapack so I can give it a look? I will try to pinpoint the problem.
heres the download www.mediafire.com/folder/scy8de0cp7w23/MyPack
I don't have premium for mediafire, so I am unable to download your datapack as a bunch of folders. It would be more ideal if you zip it up, and send it that way so it could be downloaded as one larger file. With that said, I can do it one file at a time, so that's what I did.
Regarding "tick.mcfunction", I don't see anything that should prevent this from running. However your command inside is wrong. You are telling it to execute as/at the person running the function. However when you are running it via a "tick.json" file like you are now, no one is running the function! It's only the server!
So how do we fix this? Well I would recommend changing out your "as" selector to be @a instead of @s, and change the order of the as/at around.
Your "sheep.mcfunction" file, will not constantly run. Again, "tick.json" is the only file that can make mcfunction files run on a clock. So a "sheep.json" will not have the same effect. If you want to also run "sheep.mcfunction" on a loop, you have two options. You can either run it from "tick.mcfunction" with a /function command, or you can add it to the "tick.json" file.
So assuming you want your "sheep.mcfunction" file to run and spawn infinite sheep, I would remove the "sheep.json" file. To run the "sheep.mcfunction" file, I would use the /function command inside your "tick.mcfunction" file as that gives you much more control. However, if you want to use the other method for whatever reason, you can put the following inside of your "tick.json"
Hope this helps! :)
Regarding "tick.mcfunction", I don't see anything that should prevent this from running. However your command inside is wrong. You are telling it to execute as/at the person running the function. However when you are running it via a "tick.json" file like you are now, no one is running the function! It's only the server!
So how do we fix this? Well I would recommend changing out your "as" selector to be @a instead of @s, and change the order of the as/at around.
execute as @a at @s if block ~ ~-1 ~ emerald_block run effect give @s jump_boost 3 3Your "sheep.mcfunction" file, will not constantly run. Again, "tick.json" is the only file that can make mcfunction files run on a clock. So a "sheep.json" will not have the same effect. If you want to also run "sheep.mcfunction" on a loop, you have two options. You can either run it from "tick.mcfunction" with a /function command, or you can add it to the "tick.json" file.
So assuming you want your "sheep.mcfunction" file to run and spawn infinite sheep, I would remove the "sheep.json" file. To run the "sheep.mcfunction" file, I would use the /function command inside your "tick.mcfunction" file as that gives you much more control. However, if you want to use the other method for whatever reason, you can put the following inside of your "tick.json"
{"values": ["trash:tick","trash:sheep"]}NOTE: This will likely be quite laggy with how much sheep you are spawning into your world!Hope this helps! :)
