Date: 2020/01/12 04:56:19 UTC-08:00
Type: Denizen Script
ring_particles:
type: task
debug: true
definitions: entity|flag|effect|maxLength|radius|rotation
script:
- if !<def[effect].exists> || <def[effect]> == "":
- define effect flame,0,1,0
- if !<def[maxLength].exists> || <def[maxLength]> == "":
- define maxLength 20
- if !<def[radius].exists> || <def[radius]> == "":
- define radius 1
- if !<def[rotation].exists> || <def[rotation]> == "":
- define rotation <util.random.decimal[0].to[<util.tau>]>
- define effect <def[effect].split[,].limit[4]>
- define angularVelocity <util.pi.div[16]>
- define yawAngle <def[entity].location.yaw.mul[-1].to_radians>
- while <def[entity].has_flag[<def[flag]>]>:
- define vector l@<def[rotation].cos.mul[<def[radius]>]>,0,<def[rotation].sin.mul[<def[radius]>]>
- playeffect "at:<def[entity].location.add[<def[vector].rotate_around_x[0].rotate_around_y[<def[yawAngle]>]>]>" "effect:<def[effect].get[1]||flame>" "data:<def[effect].get[2]||0>" "qty:<def[effect].get[3]||1>" "offset:<def[effect].get[4]||0>"
- define rotation <def[rotation].add[<def[angularVelocity]>]>
- if <def[loop_index].mod[10]> == "0":
- wait 1t