#running a command in random cords
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D
Open question: #1274022322394890310
Is that not working?
no
Do you have it marked as a macro line in the function?
Yeah, don't think you're using macros correctly
I'm not super well versed in them so may need to wait for a helper who is, but I do know enough to recognize this isn't correct
Could also research on your own in the meantime
https://minecraft.wiki/w/Function_(Java_Edition)
thank you
You need to put them all on a storage, then have the macro line in its own function, run the function with the storage, and also prefix the macro line with $
<@&1166082198152159386> <@&1202694677766348840>
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
start your line with $
this defines a macro line and accepts macro variables
you need to run that command in a seperate function with storage
which means you need to store inside storage, not score
instead of store result @s x run ...
use store result storage infinitygames:temp Macro.x run ...
and then run a separate function with your macro command with
function other_function with storage infinitygames:temp Macro
that I'm storing the macro compound in a tag called Macro is just an arbitrary choice btw
-# init.mcfunction
execute store result storage foo:bar value int 1 run random value 1..100
function foo:say with storage foo:bar
-# say.mcfunction
$say $(value)
copying from the wiki isnt really helping yk
i know how to read
thank you this explains it so much better
youre not supposed to copy
ik
you can’t set blocks out of render distance though, i should warn
you can forceload and unload again
cool
yeah there are ways around it i just wanted to make sure you were aware of that
i still cant seem to make it work is there any other way of inserting a value?
for setblocks commands, no
macros are your only option
can you send your functions
sure
the file?
macros are the only way unfortunately, aside from editing an entity’s position from scoreboards and then executing at the entity
a screenshot of both functions
i can also help w macros if necessary
the 4th line has to be ran inside a seperate function
!
uhh not necessarily
you cant use macros that way
if its already inside of a function run from elsewhere
u could just run that function with storage
and cause an infinite loop
- values change again
what if insted i will just /spreadplayers an interaction entity then spawn a block under it?
?
thats an option, yeah
couldnt go underground that way
^
tho wich one would be more tps efficient?
if you run A in A, then the outcome is gonna crash his world
unless you make unecessary scoreboard/storage checks
lets go over some basics:
- macro variables can only contain valurs from storage/entities/blocks
- your macro variable $(...) needs to have the same.name as your value inside storage ( a: "hello" = $(a) )
- macro lines are lines that start with $, thus allows macro variables
- macro variables are only defined through storage/entities/blocks, a function can be ran with one of these to define your macro variables ( /function foo:bar with storage ... )
save your randomized values into a storage instead of a score instead
execute store result score ... -> execute store result storage ...