VitalItem
Defines an interactable item within the Vital-Framework.
@VitalItem.Info(
name = "MyItem",
type = Material.STONE
)
public class MyItem extends VitalItem {
@Override
public void onLeftClick(PlayerInteractEvent e) {
// ...
}
@Override
public void onRightClick(PlayerInteractEvent e) {
// ...
}
@Override
public void onCooldown(PlayerInteractEvent e) {
// ...
}
@Override
public void onCooldownExpire(Player player) {
// ...
}
@Override
public void onCooldownTick(Player player) {
// ...
}
}Types
Properties
The cooldowns for each player of this item. Once the cooldown for a player expires, the player will be removed from this Map.
Functions
Gets the ItemStack for the given player.
Internal function to handle the given PlayerInteractEvent for this item. This function handles all lifecycle functions of this item and the cooldown logic.
Lifecycle function; called when this item is left- or right-clicked by a player and the player's cooldown is currently active.
Lifecycle function; called when this item's cooldown expires for a player. This function is also called when a player doesn't have this item equipped.
Lifecycle function; called when the cooldown task ticks the cooldown for this item and a given player. This function is also called when a player doesn't have this item equipped.
Lifecycle function; called when this item is right-clicked by a player and the player's cooldown is not active.
Lifecycle function; called when this item is left-clicked by a player and the player's cooldown is not active.