Interface TickContext
- All Superinterfaces:
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 TypeMethodDescriptionlongGets the duration the item has been held in milliseconds.@NotNull org.bukkit.inventory.ItemStackgetItem()Gets the item being held or worn.@NotNull org.bukkit.LocationGets the player's current location.@NotNull org.bukkit.entity.PlayerGets the player holding or wearing the item.@NotNull org.bukkit.inventory.EquipmentSlotgetSlot()Gets the equipment slot where the item is located.intGets the number of ticks this item has been held/worn.booleanisArmor()Checks if the item is equipped as armor.booleanisHeld()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
-