Enum Class CurrencyEventType

java.lang.Object
java.lang.Enum<CurrencyEventType>
dev.itsharshxd.zentrix.api.currency.CurrencyEventType
All Implemented Interfaces:
Serializable, Comparable<CurrencyEventType>, Constable

public enum CurrencyEventType extends Enum<CurrencyEventType>
Events that can trigger currency rewards or penalties.

Each value corresponds to an in-game action that may add to or subtract from a player's balance.

Example


 CurrencyService currencyService = ZentrixProvider.get().getCurrencyService();

 // Check whether kills award currency
 if (currencyService.isEventEnabled(CurrencyEventType.PLAYER_KILL)) {
     double reward = currencyService.getEventReward(CurrencyEventType.PLAYER_KILL);
     player.sendMessage("Kills award " + reward + " coins!");
 }
 
Since:
1.0.0
  • Enum Constant Details

    • GAME_WIN

      public static final CurrencyEventType GAME_WIN
      Awarded when a player/team wins the game.
    • GAME_JOIN

      public static final CurrencyEventType GAME_JOIN
      Applies when a player joins a game; the configured amount may be negative.
    • GAME_LEAVE

      public static final CurrencyEventType GAME_LEAVE
      Applies when a player leaves during active gameplay; the amount may be negative.
    • PLAYER_KILL

      public static final CurrencyEventType PLAYER_KILL
      Awarded when a player kills another player.
    • PLAYER_DEATH

      public static final CurrencyEventType PLAYER_DEATH
      Applies when a player dies; the amount may be a penalty.
    • FIRST_BLOOD

      public static final CurrencyEventType FIRST_BLOOD
      Awarded for getting the first kill in a game.
    • SURVIVES_DEATHMATCH

      public static final CurrencyEventType SURVIVES_DEATHMATCH
      Awarded for surviving until deathmatch.
    • TOP_5

      public static final CurrencyEventType TOP_5
      Awarded for reaching top 5 (last 5 teams/players). Triggers once per game per team.
    • TOP_3

      public static final CurrencyEventType TOP_3
      Awarded for reaching top 3 (last 3 teams/players). Triggers once per game per team.
    • CLASS_SELECT

      public static final CurrencyEventType CLASS_SELECT
      Awarded when a player selects or changes class.
    • CLASS_ABILITY_TRIGGER

      public static final CurrencyEventType CLASS_ABILITY_TRIGGER
      Awarded when any class ability triggers.
    • WARRIOR_TRUE_DAMAGE

      public static final CurrencyEventType WARRIOR_TRUE_DAMAGE
      Awarded when Warrior's true damage procs.
    • ARCHER_BOW_BUFF

      public static final CurrencyEventType ARCHER_BOW_BUFF
      Awarded when Archer's bow buff procs.
    • LOOTER_CHEST_BONUS

      public static final CurrencyEventType LOOTER_CHEST_BONUS
      Awarded when Looter gets a bonus item from a chest.
    • TRAPPER_FALL_REDUCTION

      public static final CurrencyEventType TRAPPER_FALL_REDUCTION
      Awarded when Trapper's fall damage reduction procs.
    • FISHERMAN_BONUS

      public static final CurrencyEventType FISHERMAN_BONUS
      Awarded when Fisherman's bonus procs.
    • MINER_AUTO_SMELT

      public static final CurrencyEventType MINER_AUTO_SMELT
      Awarded when Miner's auto-smelt procs.
    • CRAFTS_CUSTOM_RECIPE

      public static final CurrencyEventType CRAFTS_CUSTOM_RECIPE
      Awarded for crafting any custom recipe.
    • CRAFTS_FIRST_TIME

      public static final CurrencyEventType CRAFTS_FIRST_TIME
      Awarded for first-time craft of a one-time recipe.
    • LAST_TEAM_MEMBER

      public static final CurrencyEventType LAST_TEAM_MEMBER
      Awarded when a player becomes the last surviving member of their team.
    • PARTICIPATION

      public static final CurrencyEventType PARTICIPATION
      Awarded for simply participating in a game (regardless of placement).
  • Method Details

    • values

      public static CurrencyEventType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CurrencyEventType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getConfigKey

      @NotNull public @NotNull String getConfigKey()
      Returns the configuration key for this event type.

      This is the key used in currency.yml for reward settings.

      Returns:
      The config key (e.g., "player-kill", "first-blood")
    • isCombatEvent

      public boolean isCombatEvent()
      Returns whether this is a combat event.
      Returns:
      true if this event relates to combat
    • isClassEvent

      public boolean isClassEvent()
      Returns whether this is a class ability event.
      Returns:
      true if this event relates to class abilities
    • isMilestoneEvent

      public boolean isMilestoneEvent()
      Returns whether this is a milestone or position event.
      Returns:
      true if this event is a milestone achievement
    • isGameLifecycleEvent

      public boolean isGameLifecycleEvent()
      Returns whether this is a game lifecycle event.
      Returns:
      true if this event relates to game lifecycle
    • fromConfigKey

      @Nullable public static @Nullable CurrencyEventType fromConfigKey(@Nullable @Nullable String key)
      Returns the event type for a configuration key.
      Parameters:
      key - The configuration key
      Returns:
      The matching event type, or null if not found
    • fromName

      @Nullable public static @Nullable CurrencyEventType fromName(@Nullable @Nullable String name)
      Returns the event type with the given name, ignoring case.
      Parameters:
      name - The enum name
      Returns:
      The matching event type, or null if not found
    • toString

      public String toString()
      Overrides:
      toString in class Enum<CurrencyEventType>