Class ItemProjectileMechanic

All Implemented Interfaces:
ProjectileCallback

public class ItemProjectileMechanic extends MechanicComponent implements ProjectileCallback
Launches a projectile using an item as its visual that applies child components upon landing
  • Constructor Details

    • ItemProjectileMechanic

      public ItemProjectileMechanic()
  • Method Details

    • getKey

      public String getKey()
      Specified by:
      getKey in class EffectComponent
    • execute

      public boolean execute(org.bukkit.entity.LivingEntity caster, int level, List<org.bukkit.entity.LivingEntity> targets, boolean force)
      Executes the component (to be implemented)
      Specified by:
      execute in class EffectComponent
      Parameters:
      caster - caster of the skill
      level - level of the skill
      targets - targets to execute on
      force - whether skill should be forced
      Returns:
      true if executed, false if conditions not met
    • callback

      public void callback(CustomProjectile projectile, org.bukkit.entity.LivingEntity hit)
      The callback for the projectiles that applies child components
      Specified by:
      callback in interface ProjectileCallback
      Parameters:
      projectile - projectile calling back for
      hit - the entity hit by the projectile, if any
    • playPreview

      public void playPreview(List<Runnable> onPreviewStop, org.bukkit.entity.Player caster, int level, Supplier<List<org.bukkit.entity.LivingEntity>> targetSupplier)
      Starts the component's preview effects. Removal of any registered listeners, tasks, entities, or other temporary effects should be included in a Runnable added to the provided List.
      Overrides:
      playPreview in class EffectComponent
      Parameters:
      onPreviewStop - List of Runnables to add to
      caster - caster reference
      level - the level of the skill to preview for
      targetSupplier - targets to preview on