Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getEntityFromUUID(uuid: string) :: entity:
- loop all entities:
- if UUID of loop-entity is {_uuid}:
- return loop-entity
- stop loop
- function getVector(e: entity) :: vector:
- set {_nbttag} to "%tag ""Motion"" of nbt of {_e}%"
- replace "[", "]" and "d" in {_nbttag} with ""
- set {_strvalues::*} to split {_nbttag} by ","
- return new vector from {_strvalues::1} parsed as number, {_strvalues::2} parsed as number, {_strvalues::3} parsed as number
- every tick:
- loop {spiraltrail.radius::*}:
- getEntityFromUUID(loop-index) is not set
- delete {spiraltrail.radius::%loop-index%}
- delete {spiraltrail.degree2.%loop-index%}
- delete {spiraltrail.spiralpattern.%loop-index%}
- loop all projectiles:
- shooter of loop-entity is a player
- if loop-entity is on ground:
- delete {spiraltrail.radius::%UUID of loop-entity%}
- delete {spiraltrail.degree2.%UUID of loop-entity%}
- delete {spiraltrail.spiralpattern.%UUID of loop-entity%}
- else if loop-entity is not on ground:
- if {spiraltrail.radius::%UUID of loop-entity%} is not set:
- set {spiraltrail.radius::%UUID of loop-entity%} to 0.5
- if {spiraltrail.degree2.%UUID of loop-entity%} is not set:
- set {spiraltrail.degree2.%UUID of loop-entity%} to random integer between 0 and 360
- if {spiraltrail.spiralpattern.%UUID of loop-entity%} is not set:
- set {spiraltrail.spiralpattern.%UUID of loop-entity%} to random integer between 0 and 1
- set {_loc} to location of loop-entity
- loop ceil(sqrt(x of getVector(loop-entity)^2+y of getVector(loop-entity)^2+z of getVector(loop-entity)^2)*6) times:
- set yaw of {_loc} to vector yaw of getVector(loop-entity)
- set pitch of {_loc} to vector pitch of getVector(loop-entity)
- set {_inclination} to vector pitch of getVector(loop-entity)
- set {_degree1} to vector yaw of getVector(loop-entity)
- set {_r1} to {spiraltrail.radius::%UUID of loop-entity%}*cos(90-{_inclination}*-1)
- set {_r2} to {spiraltrail.radius::%UUID of loop-entity%}*sin(90-{_inclination}*-1)
- set {_x} to {_r1}*sin({spiraltrail.degree2.%UUID of loop-entity%})
- set {_y} to {_r2}*sin({spiraltrail.degree2.%UUID of loop-entity%})
- set {_z} to {spiraltrail.radius::%UUID of loop-entity%}*cos({spiraltrail.degree2.%UUID of loop-entity%})
- set {_vector} to new vector from {_x}, {_y}, {_z}
- rotate {_vector} around y axis by ({_degree1}-90)*-1
- set {_ploc} to location x of {_vector} meter east location y of {_vector} meter above location z of {_vector} meter south location of {_loc}
- show 1 flame particles at {_ploc} offset by 0, 0, 0 with speed 0
- if {spiraltrail.spiralpattern.%UUID of loop-entity%} is 0:
- add 15 to {spiraltrail.degree2.%UUID of loop-entity%}
- else if {spiraltrail.spiralpattern.%UUID of loop-entity%} is 1:
- remove 15 from {spiraltrail.degree2.%UUID of loop-entity%}
- set {_loc} to location 0.15 meter forwards {_loc}
Advertisement
Add Comment
Please, Sign In to add comment