Class ClickTrigger

java.lang.Object
studio.magemonkey.fabled.dynamic.trigger.ClickTrigger
All Implemented Interfaces:
Trigger<KeyPressEvent>
Direct Known Subclasses:
ClickLeftTrigger, ClickRightTrigger

public abstract class ClickTrigger extends Object implements Trigger<KeyPressEvent>
  • Constructor Details

    • ClickTrigger

      public ClickTrigger()
  • Method Details

    • getKey

      public abstract String getKey()
      Specified by:
      getKey in interface Trigger<KeyPressEvent>
      Returns:
      unique key for the trigger
    • getEvent

      public Class<KeyPressEvent> getEvent()
      Specified by:
      getEvent in interface Trigger<KeyPressEvent>
      Returns:
      class of the event related to the trigger
    • shouldTrigger

      public abstract boolean shouldTrigger(KeyPressEvent event, int level, Settings settings)
      Specified by:
      shouldTrigger in interface Trigger<KeyPressEvent>
      Parameters:
      event - event details
      level - the level of the owning skill
      settings - skill settings
      Returns:
      true if the skill should activate, false otherwise
    • setValues

      public void setValues(KeyPressEvent event, CastData data)
      Reads data from the event and provides values to the caster's value data. This can be used within skills for more flexible effects. An example of this in base triggers is the Launch trigger providing the speed a projectile was launched so mechanics can replace it with equally-fast projectiles.
      Specified by:
      setValues in interface Trigger<KeyPressEvent>
      Parameters:
      event - event details
      data - caster's value data to populate
    • getCaster

      public org.bukkit.entity.LivingEntity getCaster(KeyPressEvent event)
      Fetches the caster as determined by the triggering event.
      Specified by:
      getCaster in interface Trigger<KeyPressEvent>
      Parameters:
      event - event details
      Returns:
      the one to apply the trigger for
    • getTarget

      public org.bukkit.entity.LivingEntity getTarget(KeyPressEvent event, Settings settings)
      Fetches the target as determined by the triggering event. This can be the same as the caster.
      Specified by:
      getTarget in interface Trigger<KeyPressEvent>
      Parameters:
      event - event details
      settings - skill settings
      Returns:
      the one being affected by the trigger (initial target)