Promotion background
Easter Season IS HERE!
10% off limited time offer!
Ends in
00
H
00
M
00
S
limited time offer SAVE 10% NOW →
Packages com.phoenixplugins.phoenixcrates.api reward
com.phoenixplugins.phoenixcrates.api.reward

Interface BaseReward

  • All Known Subinterfaces:
    AlternativeReward, Reward


    public interface BaseReward
    A base reward that defines common properties and behavior for all types of rewards. This can be extended by more specific reward classes, such as alternative rewards or standard rewards.
    • Method Summary

      Modifier and Type Method and Description
      @Nullable Item getDisplayItem()
      Gets the display item for this reward.
      String getIdentifier()
      Gets the unique identifier for this crate reward.
      double getWeight()
      Gets the weight of this reward used for weighted-random selection.
      List<String> getWinCommands()
      Gets the list of commands to be executed when the reward is won.
      List<? extends Item> getWinItems()
      Retrieves a list of items that are awarded as part of this reward.
      boolean isAlternative()
      Determines if this reward is considered an alternative reward.
      boolean isBroadcast()
      Checks whether this reward should be broadcasted to all players when it is won.
      default boolean isSharePlayersOnline()
      Determines whether this reward should be shared only with players who are currently online.
    • Method Detail

      • getIdentifier

        String getIdentifier()
        Gets the unique identifier for this crate reward. The identifier is typically used to reference or track the reward within the crate system.
        Returns:
        the unique identifier for the reward.
      • getDisplayItem

        @Nullable
        @Nullable Item getDisplayItem()
        Gets the display item for this reward. The display item is shown as a visual representation of the reward in the UI.
        Returns:
        the Optional ItemStack representing the display item.
      • getWinItems

        List<? extends Item> getWinItems()
        Retrieves a list of items that are awarded as part of this reward. This could be a collection of items given to the player.
        Returns:
        a list of ItemStacks representing the awarded items.
      • getWinCommands

        List<String> getWinCommands()
        Gets the list of commands to be executed when the reward is won. Commands may include server-side actions like granting permissions or triggering events.
        Returns:
        a list of commands to execute upon winning this reward.
      • getWeight

        double getWeight()
        Gets the weight of this reward used for weighted-random selection. Higher weight = higher probability relative to other rewards.
        Returns:
        the weight value of this reward.
      • isBroadcast

        boolean isBroadcast()
        Checks whether this reward should be broadcasted to all players when it is won. Broadcasting allows the server to announce to all players that a reward has been won.
        Returns:
        true if the reward is broadcasted, false otherwise.
      • isSharePlayersOnline

        default boolean isSharePlayersOnline()
        Determines whether this reward should be shared only with players who are currently online. When enabled, the reward's effects (such as items or commands) are only applied to players who are online at the time the reward is given.
        Returns:
        true if the reward should be shared only among online players, false otherwise.
      • isAlternative

        boolean isAlternative()
        Determines if this reward is considered an alternative reward. Alternative rewards can be awarded in place of the main reward.
        Returns:
        true if this is an alternative reward, false if it is a primary reward.
Last updated about 3 hours ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy
This site uses cookies to personalize content, enhance your experience. By continuing, you agree to our cookie use. Learn more