#schedule a function & load load order

1 messages · Page 1 of 1 (latest)

buoyant mist
#

tick.mcfunction:
execute as @e[type=minecraft:allay] run data modify entity @e[type=minecraft:allay,limit=1,sort=nearest] Brain.memories."minecraft:liked_noteblock_cooldown_ticks".value set value 691

load.mcfunction:
tellraw @a {"text": "Hello"}

rigid cedar
#

Are you sure it is not loading? I'm think that the load function is just running before you/the chat is loaded and hence you can’t see the message

buoyant mist
#

i understand, thank you

#

if you are still here cand you help me with something else?

#

is there a way to execute a command every 100 ticks? or something like that

rigid cedar
#

Yea, the schedule command

#

Wait

#

So just schedule some:function 100t replace

buoyant mist
#

so the "replace" makes it run again?

rigid cedar
#

It is replace or append

#

Replace tells it "if there is a schedule for this command, replace it" and append tells it to run both

#

But note that it looses it's context, it is ran at the world spawn by the server, like the main and load functions

buoyant mist
#

so I do this in load, not in tick?

rigid cedar
#

Yea, you only want to schedule it once

buoyant mist
#

sorry to waste your time, this is my first time trying to make a datapack

rigid cedar
#

You can also schedule the function itself, in the scheduled function

#

schedule a function & load load order

buoyant mist
#

so I should make a function containing the commands i want to run and put that in the schedule?

#

like, a custom one other than these

rigid cedar
#

pack:load

schedule pack:slow_tick 100t replace
say loaded

pack:slow_tick

schedule pack:slow_tick 100t replace
say 100 ticks have passed
#

Yea, something like this

#

And pack:slow_tick is a new file - yea

buoyant mist
#

slow_tick.mcfunction?

rigid cedar
#

You can make as many functions as you want to - even in subfolders

rigid cedar
#

You can call it how you feel like

buoyant mist
#

and this is for java mc, just to make sure

rigid cedar
#

Yes

buoyant mist
#

ok, thanks

rigid cedar
#

You can also take a look at other peoples data packs, there are many reasons to have many functions