Class EnchantmentTickTask

java.lang.Object
io.artificial.enchantments.internal.EnchantmentTickTask
All Implemented Interfaces:
Runnable

public class EnchantmentTickTask extends Object implements Runnable
Scheduled task that scans all online players' held items and armor, dispatching EffectDispatchSpine.DispatchEventType.HELD_TICK and EffectDispatchSpine.DispatchEventType.ARMOR_TICK effects.

Runs once per second (every 20 ticks).

  • Constructor Details

    • EnchantmentTickTask

      public EnchantmentTickTask(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull FoliaScheduler scheduler, @NotNull @NotNull EffectDispatchSpine spine, @NotNull @NotNull ItemEnchantmentService itemService)
      Creates a new tick task for scanning player equipment.
      Parameters:
      plugin - the plugin instance for scheduling
      scheduler - scheduler abstraction used for the repeating scan task
      spine - the effect dispatch spine for triggering enchantment effects
      itemService - the item service for querying enchantments on items
      Since:
      0.1.0
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • start

      public void start()
      Starts the tick task, scheduling it to run every 20 ticks (1 second).
      Since:
      0.1.0
    • stop

      public void stop()
      Stops the tick task, cancelling any pending executions.
      Since:
      0.1.0