I want to create like a superpowers datapack and i am making like nature power and I need to make a power that summon vines in the directions that the player is looking but not like the vine block I need like the particles that every few blocks the ray cast would split into random directions but still move in the general direction that the player was looking at
#how to chain raycast
1 messages · Page 1 of 1 (latest)
So like a branching thing?
Just make a score that decreases and if it's 0 put it back and choose some random direction with /random where you make a new raycast
Also probably a slowcast would be better
Datapack Wiki
Like a raycast but in slow. Useful if simply using tp every tick skips over too much when making it fast.
how do I change the direction with /random
- Summon a Marker
/execute store result entity <marker> Rot[0] int 1 run random value <min>..<max>/execute as <marker> at @s run function <raycast>
wait but I want it to be in the general direction that I fired with like a range of like ~-40..40 ~ and not a set value cuz I dont want it return to the back
and how do I make it faster?
I wouldn't use a marker but instead use recursive functions. The user won't really see the difference between a rotation of 1 deg and a rotation of 2 deg, so you can just hardcode some rotations and select between those to call the same function again