Please have a look at the attached mcfunction. There are some lines that make an aoe cloud run another function when a button at specified coordinates is pressed. When this function is repeated on a command block with "function drgrid:tenticks", the button gives responses; but it doesnt seem to work on itself, even with the first line "schedule function drgrid:tenticks 10". Is there something wrongwith the /schedule command? I would prefer not to put it in the tick tag, as the other function would spam the chat with /tellraw if it's run on each tick.
Version: 1.20.1 forge
#mcfunction seems not to be repeating itself even with /schedule function
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
Someone will come and help soon!
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
really? I thought it gives a syntax error
okie I'll try and get back here after a moment, not sure why there's other two functions that works without the units but this one just doesnt
Presumably the file is located in data/drgrid/functions/tenticks.mcfunction
Also are you sure the functions isn't running and it's not some other part of your code that isn't working?
Try adding a /say command in there to see when it's running
And of course, make sure you run the function in the first place
tried specifying the unit but no luck, but pressing the button still give responses with a repeating command block "/function drgrid:tenticks" just like before
file location checked, it's exactly like the path you gave
it's very weird how the mcfunction would run on command blocks, but not in the data pack, not even after manually running it once
yes
The only thing I can think would be different between command blocks and functions is the context (e.g. where the command is run)
same, I specifically used an aoe cloud to run it as these coordinates aren't in the spawn chunks, so it would run as long as somebody's loading the chunks and therefore loading the aoe cloud
"function drgrid:tenticks"
hmm ok that's fine then
It may not work if you were running the function in some context
I really don't know tbh
would there be some sort of workaround? A button that triggers a function without a command block directly visible in the player's sight
There's surely a reason this isn't working, and it (almost) definitely is fixable, I'm jus not sure as to what/how that is
would you mind testing the full data pack? There's some Chinese in the /tellraw messages but it shouldn't be relevant
Try checking the logs first
:information_source: Default Launcher Logs
The logs are where Minecraft displays errors when something goes wrong and can thus help you gain information about why something isn't working for you!
To open the logs:
- Enable logs in the Minecraft Launcher
- Start your game (or restart it if you already have an open instance)
- Enjoy spotting errors getting much easier!
If there's no errors there I can look into it
I checked the logs before, but all results that comes from "drgrid:tenticks" came from the command blocks and I couldn't find any obvious errors when it was loaded
and just to be sure I reopened the world a few times in stead of using /reload or disabling and re-enabling it
version: 1.20.1
there's some fixed coordinates so it might be better to test it on a superflat
understandable, this is a really weird one, thank you for helping me out ❤️
update, this might be some progress: I tried messing around with /function and actually executing commands inside the function, now I suspect that it's the other function it calls upon that's not working properly
execute as @e[type=minecraft:area_effect_cloud,tag=drgridcheckpoint1] run tellraw @a[distance=..3] "congrats"
I tried running this in a command block and move around
I receive the tellraw message near the command block, but not near the aoe cloud
oh no i didn't expect the other function to be the culprit but I really think this is where it is, I ran it like execute as @e[tag=drgridcheckpoint1] if block 2024 69 1060 minecraft:stone_button[powered=true] run execute as @e[tag=drgridcheckpoint1] run function drgrid:checkpoint1
so now the problem should be
how to run a command as an aoe cloud entity on nearby players?
Am I doing it right by this? execute as @e[type=minecraft:area_effect_cloud] run tellraw @a[distance=..3] "message"
Yes, but you need to add at @s so the command is executed at the area effect cloud rather than world spawn
ahhhhh ok I'm trying this immediately
it works now oh god I didnt expect the error to be over there I'm so sorry
thank you very much
That's why I suggested only testing the scheduled function to make sure the bug wasn't somewhere else in the code
🎗️ Is your question resolved?
If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D
Question Closed
Your question, #1246079911379341382 (mcfunction seems not to be repeating itself even with /schedule function), was resolved!
Original Message
#1246079911379341382 message
Duration open
1h13m
maybe I didn't test it the right way or I misunderstood something, anyways big thanks for helping out!
Re-opened the channel. Make sure to close it again once you're done.