akon1248

Untitled

Apr 2nd, 2019
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. function getEntityFromUUID(uuid: string) :: entity:
  2. loop all entities:
  3. if UUID of loop-entity is {_uuid}:
  4. return loop-entity
  5. stop loop
  6. function getVector(e: entity) :: vector:
  7. set {_nbttag} to "%tag ""Motion"" of nbt of {_e}%"
  8. replace "[", "]" and "d" in {_nbttag} with ""
  9. set {_strvalues::*} to split {_nbttag} by ","
  10. return new vector from {_strvalues::1} parsed as number, {_strvalues::2} parsed as number, {_strvalues::3} parsed as number
  11. every tick:
  12. loop {spiraltrail.radius::*}:
  13. getEntityFromUUID(loop-index) is not set
  14. delete {spiraltrail.radius::%loop-index%}
  15. delete {spiraltrail.degree2.%loop-index%}
  16. delete {spiraltrail.spiralpattern.%loop-index%}
  17. loop all projectiles:
  18. shooter of loop-entity is a player
  19. if loop-entity is on ground:
  20. delete {spiraltrail.radius::%UUID of loop-entity%}
  21. delete {spiraltrail.degree2.%UUID of loop-entity%}
  22. delete {spiraltrail.spiralpattern.%UUID of loop-entity%}
  23. else if loop-entity is not on ground:
  24. if {spiraltrail.radius::%UUID of loop-entity%} is not set:
  25. set {spiraltrail.radius::%UUID of loop-entity%} to 0.5
  26. if {spiraltrail.degree2.%UUID of loop-entity%} is not set:
  27. set {spiraltrail.degree2.%UUID of loop-entity%} to random integer between 0 and 360
  28. if {spiraltrail.spiralpattern.%UUID of loop-entity%} is not set:
  29. set {spiraltrail.spiralpattern.%UUID of loop-entity%} to random integer between 0 and 1
  30. set {_loc} to location of loop-entity
  31. loop ceil(sqrt(x of getVector(loop-entity)^2+y of getVector(loop-entity)^2+z of getVector(loop-entity)^2)*6) times:
  32. set yaw of {_loc} to vector yaw of getVector(loop-entity)
  33. set pitch of {_loc} to vector pitch of getVector(loop-entity)
  34. set {_inclination} to vector pitch of getVector(loop-entity)
  35. set {_degree1} to vector yaw of getVector(loop-entity)
  36. set {_r1} to {spiraltrail.radius::%UUID of loop-entity%}*cos(90-{_inclination}*-1)
  37. set {_r2} to {spiraltrail.radius::%UUID of loop-entity%}*sin(90-{_inclination}*-1)
  38. set {_x} to {_r1}*sin({spiraltrail.degree2.%UUID of loop-entity%})
  39. set {_y} to {_r2}*sin({spiraltrail.degree2.%UUID of loop-entity%})
  40. set {_z} to {spiraltrail.radius::%UUID of loop-entity%}*cos({spiraltrail.degree2.%UUID of loop-entity%})
  41. set {_vector} to new vector from {_x}, {_y}, {_z}
  42. rotate {_vector} around y axis by ({_degree1}-90)*-1
  43. set {_ploc} to location x of {_vector} meter east location y of {_vector} meter above location z of {_vector} meter south location of {_loc}
  44. show 1 flame particles at {_ploc} offset by 0, 0, 0 with speed 0
  45. if {spiraltrail.spiralpattern.%UUID of loop-entity%} is 0:
  46. add 15 to {spiraltrail.degree2.%UUID of loop-entity%}
  47. else if {spiraltrail.spiralpattern.%UUID of loop-entity%} is 1:
  48. remove 15 from {spiraltrail.degree2.%UUID of loop-entity%}
  49. set {_loc} to location 0.15 meter forwards {_loc}
Advertisement
Add Comment
Please, Sign In to add comment