Class CommandReward
java.lang.Object
com.Moshu.TreasureHunt.Components.Rewards.CommandReward
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
boolean
isTopX
(int currentTop) void
run
(org.bukkit.entity.Player p) Executes the command reward for the specified player.void
setChance
(int chance) void
setCommand
(String command) void
setIdentifier
(String identifier) void
setMenuItem
(String menuItem) void
setRewardToTopX
(int rewardToTopX) boolean
-
Constructor Details
-
CommandReward
public CommandReward()Creates a new command reward with default values.
-
-
Method Details
-
getIdentifier
-
setIdentifier
-
setRewardToTopX
public void setRewardToTopX(int rewardToTopX) -
getRewardToTopX
public int getRewardToTopX() -
shouldRewardToTopX
public boolean shouldRewardToTopX() -
isTopX
public boolean isTopX(int currentTop) -
getCommand
-
setCommand
-
getChance
public int getChance() -
setChance
public void setChance(int chance) -
getMenuItem
-
setMenuItem
-
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
-