Interface TickContext

All Superinterfaces:
EffectContext

public interface TickContext extends EffectContext
Context for periodic tick-based enchantment effects.

Provides access to player, item, slot, and timing data for enchantments that apply effects while an item is held or worn. Called periodically for held items and equipped armor.

Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Gets the duration the item has been held in milliseconds.
    @NotNull org.bukkit.inventory.ItemStack
    Gets the item being held or worn.
    @NotNull org.bukkit.Location
    Gets the player's current location.
    @NotNull org.bukkit.entity.Player
    Gets the player holding or wearing the item.
    @NotNull org.bukkit.inventory.EquipmentSlot
    Gets the equipment slot where the item is located.
    int
    Gets the number of ticks this item has been held/worn.
    boolean
    Checks if the item is equipped as armor.
    boolean
    Checks if the item is being held in main or off hand.

    Methods inherited from interface io.artificial.enchantments.api.context.EffectContext

    getEnchantment, getLevel, getScaledValue, isCancellable, isCancelled, tryCancel
  • Method Details

    • getPlayer

      @NotNull @NotNull org.bukkit.entity.Player getPlayer()
      Gets the player holding or wearing the item.
      Returns:
      the player
    • getItem

      @NotNull @NotNull org.bukkit.inventory.ItemStack getItem()
      Gets the item being held or worn.
      Returns:
      the item
    • getSlot

      @NotNull @NotNull org.bukkit.inventory.EquipmentSlot getSlot()
      Gets the equipment slot where the item is located.
      Returns:
      the equipment slot
    • getLocation

      @NotNull @NotNull org.bukkit.Location getLocation()
      Gets the player's current location.
      Returns:
      the location
    • isHeld

      boolean isHeld()
      Checks if the item is being held in main or off hand.
      Returns:
      true if held
    • isArmor

      boolean isArmor()
      Checks if the item is equipped as armor.
      Returns:
      true if armor
    • getTickCount

      int getTickCount()
      Gets the number of ticks this item has been held/worn.
      Returns:
      the tick count
    • getHeldDuration

      long getHeldDuration()
      Gets the duration the item has been held in milliseconds.
      Returns:
      the held duration