#function macros
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 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
you can't target arrays in the passed data
you can only target primitive values
int/float/... /string
how could I do it then?
could I do:
// tick.mcfunction:
function clan:border with entity Ferrarex Pos[1]
// border.mcfunction
$execute as @a at @e[tag=Base] positioned ~ $() ~ run particle dust{color:[1,0,0],scale:2} ^ ^ ^100 0 0 0 0 100 force @s
but what would I place at $()?
store the y value in a data store in advance, then pass in that data storage
you could simply name the key Y
not familiar with functions
how do i do such?
[35mdata [34mmodify storage [33mclan:temp [0mY [34mset from entity [36m@s [0mPos[33m[[32m1[33m]
[35mfunction [33mclan:border [34mwith storage [33mclan:temp
[37m$[35mexecute [34mas [36m@a [34mat [36m@e[33m[[37mtag[34m=[32mBase[33m] [34mpositioned [32m~ [34m$[33m([0mY[33m) [32m~ [34mrun [35mparticle [0mdust[33m{[37mcolor[34m:[35m[[32m1[34m,[32m0[34m,[32m0[35m][34m,[37mscale[34m:[32m2[33m} [32m^ ^ ^100 0 0 0 0 100 [34mforce [36m@s
There might be better ways to do this maybe. Running a macro every tick is horrible for performance. It can only cache the last 5 times you passed data
in what ways could it be done?
idk what you're trying to do. I need a little bit more info on what this is for and what it's supposed to do.
it's supposed to draw a particle dust at the height of the entity in @s, but 100 distance from the entity at @e[tag=Base]
and based on that entity's angle too
I was gonna do:
execute as @a run function clan:border with entity @s
I see now it's not like it's in the command and I didn't notice
In this case there is really no better way without some crazy complex hacky trickery
// tick
execute as @a run function clan:border with entity @s
// border
data modify storage clan:temp Y set from entity @s Pos[1]
function clan:drawborder with storage clan:temp
// drawborder
$execute as @e[tag=Base] at @s positioned ~ $(Y) ~ run particle dust{color:[1,0,0],scale:2} ^ ^ ^100 0 0 0 0 10 force @a
got to this, but instead of force @a, i would need the player in "execute as @a" on tick
know how I could do it?
<@&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)
I do have an idea how you can easily make this without macros
I'm testing rq
I don't want to tell wrong things
ok, it did not work as I imagined.
But this will do what you want if you use it instead of the current command:
$execute at @e[tag=Base] ~ $(Y) ~ run particle dust{color:[1,0,0],scale:2} ^ ^ ^100 0 0 0 0 10 force @s
at @s at @e?
fixed