Enum Class CurrencyEventType
- All Implemented Interfaces:
Serializable,Comparable<CurrencyEventType>,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAwarded when Archer's bow buff procs.Awarded when any class ability triggers.Awarded when a player selects or changes class.Awarded for crafting any custom recipe.Awarded for first-time craft of a one-time recipe.Awarded for getting the first kill in a game.Awarded when Fisherman's bonus procs.Applies when a player joins a game; the configured amount may be negative.Applies when a player leaves during active gameplay; the amount may be negative.Awarded when a player/team wins the game.Awarded when a player becomes the last surviving member of their team.Awarded when Looter gets a bonus item from a chest.Awarded when Miner's auto-smelt procs.Awarded for simply participating in a game (regardless of placement).Applies when a player dies; the amount may be a penalty.Awarded when a player kills another player.Awarded for surviving until deathmatch.Awarded for reaching top 3 (last 3 teams/players).Awarded for reaching top 5 (last 5 teams/players).Awarded when Trapper's fall damage reduction procs.Awarded when Warrior's true damage procs. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable CurrencyEventTypefromConfigKey(@Nullable String key) Returns the event type for a configuration key.static @Nullable CurrencyEventTypeReturns the event type with the given name, ignoring case.@NotNull StringReturns the configuration key for this event type.booleanReturns whether this is a class ability event.booleanReturns whether this is a combat event.booleanReturns whether this is a game lifecycle event.booleanReturns whether this is a milestone or position event.toString()static CurrencyEventTypeReturns the enum constant of this class with the specified name.static CurrencyEventType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GAME_WIN
Awarded when a player/team wins the game. -
GAME_JOIN
Applies when a player joins a game; the configured amount may be negative. -
GAME_LEAVE
Applies when a player leaves during active gameplay; the amount may be negative. -
PLAYER_KILL
Awarded when a player kills another player. -
PLAYER_DEATH
Applies when a player dies; the amount may be a penalty. -
FIRST_BLOOD
Awarded for getting the first kill in a game. -
SURVIVES_DEATHMATCH
Awarded for surviving until deathmatch. -
TOP_5
Awarded for reaching top 5 (last 5 teams/players). Triggers once per game per team. -
TOP_3
Awarded for reaching top 3 (last 3 teams/players). Triggers once per game per team. -
CLASS_SELECT
Awarded when a player selects or changes class. -
CLASS_ABILITY_TRIGGER
Awarded when any class ability triggers. -
WARRIOR_TRUE_DAMAGE
Awarded when Warrior's true damage procs. -
ARCHER_BOW_BUFF
Awarded when Archer's bow buff procs. -
LOOTER_CHEST_BONUS
Awarded when Looter gets a bonus item from a chest. -
TRAPPER_FALL_REDUCTION
Awarded when Trapper's fall damage reduction procs. -
FISHERMAN_BONUS
Awarded when Fisherman's bonus procs. -
MINER_AUTO_SMELT
Awarded when Miner's auto-smelt procs. -
CRAFTS_CUSTOM_RECIPE
Awarded for crafting any custom recipe. -
CRAFTS_FIRST_TIME
Awarded for first-time craft of a one-time recipe. -
LAST_TEAM_MEMBER
Awarded when a player becomes the last surviving member of their team. -
PARTICIPATION
Awarded for simply participating in a game (regardless of placement).
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getConfigKey
Returns the configuration key for this event type.This is the key used in
currency.ymlfor reward settings.- Returns:
- The config key (e.g., "player-kill", "first-blood")
-
isCombatEvent
public boolean isCombatEvent()Returns whether this is a combat event.- Returns:
trueif this event relates to combat
-
isClassEvent
public boolean isClassEvent()Returns whether this is a class ability event.- Returns:
trueif this event relates to class abilities
-
isMilestoneEvent
public boolean isMilestoneEvent()Returns whether this is a milestone or position event.- Returns:
trueif this event is a milestone achievement
-
isGameLifecycleEvent
public boolean isGameLifecycleEvent()Returns whether this is a game lifecycle event.- Returns:
trueif this event relates to game lifecycle
-
fromConfigKey
Returns the event type for a configuration key.- Parameters:
key- The configuration key- Returns:
- The matching event type, or null if not found
-
fromName
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
- Overrides:
toStringin classEnum<CurrencyEventType>
-