Class CommandReward

java.lang.Object
com.Moshu.TreasureHunt.Components.Rewards.CommandReward

public class CommandReward extends Object
Represents a command reward that can be executed for players during treasure hunts. This class manages the execution of console commands as rewards, with support for chance-based execution and top-X player targeting.
  • Constructor Details

    • CommandReward

      public CommandReward()
      Creates a new command reward with default values.
  • Method Details

    • getIdentifier

      public String getIdentifier()
    • setIdentifier

      public void setIdentifier(String identifier)
    • setRewardToTopX

      public void setRewardToTopX(int rewardToTopX)
    • getRewardToTopX

      public int getRewardToTopX()
    • shouldRewardToTopX

      public boolean shouldRewardToTopX()
    • isTopX

      public boolean isTopX(int currentTop)
    • getCommand

      public String getCommand()
    • setCommand

      public void setCommand(String command)
    • getChance

      public int getChance()
    • setChance

      public void setChance(int chance)
    • getMenuItem

      public String getMenuItem()
    • setMenuItem

      public void setMenuItem(String menuItem)
    • run

      public void run(org.bukkit.entity.Player p)
      Executes the command reward for the specified player. The command is executed with chance-based probability and player name replacement.
      Parameters:
      p - The player to execute the command for