Skip to content
JasperLorelai edited this page Nov 1, 2020 · 49 revisions

Description

Spell effects can be played at selected positions to make the effect play at the start, during or after a spell is casted. For example, you could make lightning strike you when you cast a particle projectile, you could make it cast at the position of the projectile all throughout its flight at a set interval, you could make it strike where the projectile lands, etc.

You can define spell effects in the spell option effects. This is not where the effect options go, but the effect name section which includes all of the effect options.

spell:
    spell-class: ".targeted.DummySpell"
    effects: # <-- Here
      1:
        position: target
        effect: lightning
      2:
        position: caster
        effect: particles
        particle-name: end_rod
        horiz-spread: .5
        vert-spread: .5
        speed: .1
        count: 10

The map keys 1 and 2 are the names of effects. The name of the effect does not matter. You could use them to describe the effect - you could rename 2 to Particles if you want. It's just important you don't have two same map keys in a map.

Configuration

For a spell effect to load successfully it needs to have at least a defined position and effect with valid values.

Source Code

General Configuration:

Option Description Default value
delay Defines delay in ticks before the effect is played. 0
chance Defines chance of the effect playing. -1 (basically 100%)
z-offset Defines offset of the effect location on the Z axis. 0
height-offset Same as above, but for the Y axis. 0
forward-offset Same as above, but for the X axis. 0
offset Vector offset instead of the above properties. Format: "x,y,z". "0,0,0"
relative-offset Same as above, but it's relative. "0,0,0"
modifiers Modifiers which determine whether the spell effect should be played or not.
location-modifiers Same as above but the conditions check location.

Effect Positions (and their options):

The configuration name Description
start or startcast Plays when the spell starts casting. This position does not wait for cast-time to finish.
pos1, position1, caster or actor Plays the effect at the caster's position on the successful cast.
pos2, position2 or target Plays the effect at the target's position or targeted location if either found.
line or trail (Options) If a target or targeted location is present, this position plays the effect as a trail between the caster and the target (or targeted location) in that order.
reverse_line, reverseline or rline (Options) A reverse version of the above.
disabled Plays when: a Beam or BlockBeam spell hits a non transparent block, a Buff spell fades, the entity has an active Haste spell and they stop sprinting, the entity dismounts from a Steed spell, a Totem spell ends (at it's location), etc.
delayed Plays when a spell ends at the location - when projectiles land or hit something, when pulsers or totem spells end, etc.
special Plays the effect instantly at the center of an AreaEffect spell. It can also play at the location of these spells: Beam, BlockBeam, Bomb, HomingMissile, HomingProjectile, ItemProjectile, Orbit, ParticleProjectile, Projectile - on the interval defined by the specific spell option on these spells, until they land or hit something. Or it can play at the location of entities created by the types of conjure spells until they are picked up or despawned. The interval is also specified by their specific spell options.
buff or active(Options) Plays the effect at the affected entity until the buff ends.
orbit (Options) Plays the effect at orbit's location until the buff ends.

Line position-specific options:

Options Description Default Value
max-distance If the distance between the two points is greater than the max distance defined by this option the effect will not play. 100 (Blocks)
distance-between Defines the distance before the next effect should be played - until the second point is reached. 1.0 (Block distance, double value)

Buff position-specific options:

Options Description Default Value
effect-interval The interval in ticks for the effect - the delay to wait before playing it again until the buff ends. 20
modifiers Conditions for this spell effect to play. (It's in the buff and orbit effect position because it only supports runnable effects - these positions) null

Orbit position-specific options:

Options Description Default Value
orbit-radius The starting radius of the orbit. 1.0 (Block distance)
orbit-y-offset The starting height offset. 0.0 (Block distance)
orbit-horiz-offset The starting horizontal offset. 0.0 (Block distance)
orbit-horiz-expand-radius The horizontal radius to expand on interval defined by orbit-horiz-expand-delay. 0.0 (Block distance)
orbit-horiz-expand-delay The interval in ticks at which to expand the horizontal radius of the orbit - distance is defined by orbit-horiz-expand-radius. 0 ticks
orbit-vert-expand-radius The vertical radius to expand on interval defined by orbit-vert-expand-delay. 0.0 (Block distance)
orbit-vert-expand-delay The interval in ticks at which to expand the vertical radius of the orbit - distance is defined by orbit-vert-expand-radius. 0 ticks
orbit-seconds-per-revolution Duration of one full cycle of the orbit defined in seconds. 3.0s
orbit-tick-interval The interval in ticks for the orbit effect task. 0 ticks

Effect Types:

The effect types that have a hyperlink include special options that are specific to that effect. Click on the hyperlink to see the configuration of these options.

Types:

  • armorstand - (not documented yet)
  • actionbartext
  • bossbar
  • broadcast
  • cloud- Creates a cloud of smoke, has the radius option.
  • dragondeath - Creates the visual of an ender dragon death.
  • ender - Plays the effect when an eye of ender is broken.
  • entity - (not documented yet)
  • explosion - Creates a small explosion.
  • fireworks
  • itemcooldown (not documented yet)
  • itemspray (not documented yet)
  • lightning - Creates a lightning strike.
  • nova
  • particles
  • particlespersonal (not documented yet)
  • particlecloud
  • potion (not documented yet)
  • smoketrail (not documented yet)
  • smokeswirl - Creates an orbiting swirl of smoke, has the duration option.
  • sound
  • soundpersonal (not documented yet)
  • spawn - Plays the effect when a spawner spawns a mob.
  • splash - Plays the effect when a splash potion is thrown.
  • title
  • effectlib
  • effectlibline - used instead of effectlib, creates an effectlib line.
  • effectlibentity - used instead of effectlib, uses an entity to play the effects while normal plays the effect every tick.

Particle Cloud:

Description: Creates a 'cloud' of particles.

Source Code

Configuration:

Option Description Default Value
duration How long should the cloud last (in ticks) 60
radius-per-tick How much bigger should the radius get every tick? 0
particle The particle name to use for the cloud EXPLOSION_NORMAL
radius The initial radius for the cloud 5
y-offset the starting y offset of the effect 0

Example:

cloud:
    spell-class: .instant.DummySpell
    effects:
        '1':
            position: caster
            effect: particlecloud
            duration: 200
            radius-per-tick: 0.1
            y-offset: 8

Back to Effect Types

Clone this wiki locally