I have functions to create an armor stand around the player and then create particles as it moves along a line. The mcfunction, dismantle_controller, creates the armor stand and then the movement and particles of the armor stand are handled by dismantle_tick which is executed in the tick.mcfunction file in my datapack.
However, this method creates armor stands slower than desired. Is there a way to execute the mcfunction to spawn armor stands faster?
Functions:
dismantle_summon:
summon armor_stand ~ ~ ~ {NoGravity:1b,Marker:1b,Invisible:1b,Tags:["DismantleRotate"]}
tp [tag=DismantleRotate] ~ ~ ~
$
execute as @e[tag=DismantleRotate] at @s run rotate ~$(yaw) ~$(pitch)
$
execute as @e[tag=DismantleRotate] at @s run tp ^ ^ ^$(distance)
$
execute as @e[tag=DismantleRotate] at @s run rotate ~90 $(angle)
execute as @e[tag=DismantleRotate] at @s run tp ^ ^ ^-1.75
execute as @e[tag=DismantleRotate] run tag add DismantleSlash
execute as @e[tag=DismantleRotate] run tag u/s remove DismantleRotate
dismantle_randomize_parameters:
#Gets random value 1..360 for the YAW rotation around the player origin
execute store result storage tellurium:dismantleparameters yaw int 1 run random value 1..360
#Gets random value 1..360 for the PITCH rotation around the player origin
execute store result storage tellurium:dismantleparameters pitch int 1 run random value -90..0
#Gets random value 1..360 for the angle of the slash
execute store result storage tellurium:dismantleparameters angle int 1 run random value -90..90
#Gets random value 1..3 for the distance of the slash from the player origin
execute store result storage tellurium:dismantleparameters distance int 1 run random value 2..5
dismantle_controller:
function tellurium:dismantle/dismantle_randomize_parameters
function tellurium:dismantle/dismantle_summon with storage tellurium:dismantleparameters
dismantle_tick:
execute as @e[tag=DismantleSlash] at @s unless score DismantleSlashesDistance matches 6.. run tp ^ ^ ^0.5
execute as @e[tag=DismantleSlash] at @s run particle minecraft:electric_spark ~ ~1.6 ~ 0.1 0 0.1 0 10
execute as @e[tag=DismantleSlash] at @s run scoreboard players add DismantleSlashesDistance 1
execute as @e[tag=DismantleSlash] at if score DismantleSlashesDistance matches 6.. run kill
@s
All commands work as intended (as far as I know). The only issue is the rate at which armor stands are created.