Tick Handlers are the section where scripts are written. In addition, the number of times these scripts are run can also be set. Any number of Tick Handlers can be added, with the one added at the beginning running first (order sensitive).
Copy interval: <INTEGER> # In ticks, default=1
on-tick:
example-tick-handler: # Tick handler key
event: <EVENT> # Required
display-name: <STRING> # Optional, default="[<INDEX>]"
interval: <INTEGER> # Optional, default="effect interval"
times: <INTEGER> # Optional, default=1
mixer-options: # Optional
private: <BOOLEAN> # Optional, default=false
lock-event: <BOOLEAN> # Optional, default=true
depend: <LIST> # Optional, default=empty list
scripts:
- ...
- ...
Copy effects:
example-effect:
display-name: "%example%"
variables: [ 'r', 'x','y' ]
interval: 10 # in ticks
on-tick:
tick-handler-1:
event: ELYTRA
times: 32 # How many times will 'do' lines invoke
scripts:
- ...
- ...
tick-handler-2:
event: PROJECTILE
scripts:
- ...
- ...
Copy effects:
rainbow-circle:
display-name: "Rainbow Circle"
variables: [ 'r', 'x', 'y' ]
interval: 1
on-tick:
spawn-particle:
event: ELYTRA
times: 32
scripts: # Don't copy paste this code, use 'circle' script instead.
- variable r=2*{PI}*{i}/32
- variable x=cos({r})
- variable y=sin({r})
- particle [effect=minecraft:dust,direction=true,pos={x={x};y={y}},amount=10,origin=head*-1.25,color={name=rainbow;speed=0.75}]
play-sound:
event: ELYTRA
scripts:
- sound [name=entity.arrow.hit_player,client=true,volume=0.1,pitch=1]
send-action-bar:
event: ELYTRA
scripts:
- actionbar <rainbow><b>COOL RAINBOW EFFECT!