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 AlternativeReward

  • All Superinterfaces:
    BaseReward


    public interface AlternativeReward
    extends BaseReward
    Represents an alternative reward that can be given to a player. Alternative rewards are used when the primary reward is not available or as a fallback option. This interface implements the BaseReward interface to provide shared functionality.
    • Method Summary

      Modifier and Type Method and Description
      default Item getDisplayItem()
      Retrieves the display item for this alternative reward.
      default String getIdentifier()
      Gets the unique identifier for this crate reward.
      Item getItem()
      Deprecated. 

      This method is deprecated and will be removed in the future. Instead of using getItem(), you should use getDisplayItem().

      It is recommended to start using getDisplayItem() immediately for better compatibility with future versions.

      default double getWeight()
      Gets the weight of this reward used for weighted-random selection.
      default List<? extends Item> getWinItems()
      Gets the list of items the player will win when they receive this alternative reward.
      default boolean isAlternative()
      Overrides the method from BaseReward to indicate if this is an alternative reward.
      boolean isEnabled()
      Checks if this alternative reward is enabled.
      boolean isVirtual()
      Deprecated. 

      This method is deprecated and will be removed in the future. Instead of using isVirtual(), you should use getDisplayItem() or getWinItems().

      This method is only provided for compatibility with the older system and should not be used going forward.

    • Method Detail

      • isEnabled

        boolean isEnabled()
        Checks if this alternative reward is enabled. If the reward is disabled, it won't be awarded to players.
        Returns:
        true if the alternative reward is enabled, false otherwise.
      • getItem

        @Deprecated
        Item getItem()
        Deprecated. 

        This method is deprecated and will be removed in the future. Instead of using getItem(), you should use getDisplayItem().

        It is recommended to start using getDisplayItem() immediately for better compatibility with future versions.

        Returns:
        the ItemStack representing the alternative reward (deprecated method).
      • isVirtual

        @Deprecated
        boolean isVirtual()
        Deprecated. 

        This method is deprecated and will be removed in the future. Instead of using isVirtual(), you should use getDisplayItem() or getWinItems().

        This method is only provided for compatibility with the older system and should not be used going forward.

        Returns:
        whether the reward is virtual (deprecated).
      • getDisplayItem

        default Item getDisplayItem()
        Retrieves the display item for this alternative reward. The display item is shown as a visual representation of the reward, such as an icon in the UI.
        Specified by:
        getDisplayItem in interface BaseReward
        Returns:
        an Optional containing the display ItemStack, or empty if no display item is set.
      • getWinItems

        default List<? extends Item> getWinItems()
        Gets the list of items the player will win when they receive this alternative reward. This can be a list of ItemStacks that represent physical items given to the player.
        Specified by:
        getWinItems in interface BaseReward
        Returns:
        a list of ItemStacks representing the reward items.
      • isAlternative

        default boolean isAlternative()
        Overrides the method from BaseReward to indicate if this is an alternative reward.
        Specified by:
        isAlternative in interface BaseReward
        Returns:
        true, since this is always an alternative reward.
      • getIdentifier

        default String getIdentifier()
        Description copied from interface: BaseReward
        Gets the unique identifier for this crate reward. The identifier is typically used to reference or track the reward within the crate system.
        Specified by:
        getIdentifier in interface BaseReward
        Returns:
        the unique identifier for the reward.
      • getWeight

        default double getWeight()
        Description copied from interface: BaseReward
        Gets the weight of this reward used for weighted-random selection. Higher weight = higher probability relative to other rewards.
        Specified by:
        getWeight in interface BaseReward
        Returns:
        the weight value of this 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