Skip to content
JasperLorelai edited this page Mar 21, 2022 · 7 revisions

Hold Right Spell

Source Code

Description: Targeted spell. The HoldRightSpell allows for the caster to continuously cast a spell at an entity or block location while holding down right click, even despite targeting and line of sight.

Note: For reset-time values under 500, targeting is not maintained and the spell does not continuously cast.

Configuration:

Option Description Type Default Value
spell Spell to cast when holding right click. This spell must implement TargetedEntitySpell or TargetedLocationSpell. String ""
target-entity Whether the spell should target an entity. Boolean true
target-location Whether the spell should target a block location. Boolean false
reset-time Time it takes in milliseconds for the caster to be able to target another entity or location with the spell after releasing right click. Integer 250
max-duration Maximum duration that the spell can target an entity or location in seconds. Float 0
max-distance Maximum distance the caster can be from the target while holding down right click for spell to cast. Float 0

Example:

#Strikes targeted entity with lightning for up to 5 seconds while holding down right click
#as long as the caster remains within 10 blocks of the target.

HoldRightLightning:
    spell-class: ".targeted.HoldRightSpell"
    right-click-cast-item: golden_sword
    spell: lightning
    target-entity: true
    target-location: false
    reset-time: 1000
    max-duration: 5
    max-distance: 10
Clone this wiki locally