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>
Represents the types of events that can trigger currency rewards or penalties.

Each event type corresponds to a specific in-game action that may award or deduct currency from a player's balance.

Example Usage


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

 // Check if 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
      Awarded/deducted when a player joins a game.
    • GAME_LEAVE

      public static final CurrencyEventType GAME_LEAVE
      Applied when a player leaves during active gameplay (can 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
      Applied when a player dies (can be a penalty/negative value).
    • 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 bonus item from 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()
      Gets the configuration key for this event type.

      This is the key used in currency.yml to configure rewards.

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

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

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

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

      public boolean isGameLifecycleEvent()
      Checks if 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)
      Gets a CurrencyEventType from its 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)
      Gets a CurrencyEventType from its name (case-insensitive).
      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>