java.lang.Object
com.ordwen.odailyquests.quests.player.progression.clickable.QuestCommand<PlaceholderQuest>
com.ordwen.odailyquests.quests.player.progression.clickable.commands.PlaceholderQuestCommand

public class PlaceholderQuestCommand extends QuestCommand<PlaceholderQuest>
Command implementation for handling quests of type PLACEHOLDER.

This command evaluates a placeholder-based condition for the executing player. It checks whether PlaceholderAPI is available, resolves the placeholder and expected values, and compares them according to the quest's ConditionOperator.

If the condition matches, the quest is completed. If the condition cannot be evaluated due to invalid input format, or if it does not match, the player receives appropriate feedback messages defined by the quest configuration.

  • Constructor Details

    • PlaceholderQuestCommand

      public PlaceholderQuestCommand(QuestContext context, Progression progression, PlaceholderQuest quest)
      Creates a new command for evaluating a placeholder quest.
      Parameters:
      context - the quest context providing execution details
      progression - the current progression of the player
      quest - the placeholder quest being executed
  • Method Details

    • execute

      public void execute()
      Executes the validation of a placeholder quest.
      • Ensures the player is allowed to progress in the quest.
      • Verifies that PlaceholderAPI is enabled.
      • Resolves and compares the placeholder value with the expected value.
      • Completes the quest if the condition is satisfied, or displays an error message otherwise.
      Specified by:
      execute in class QuestCommand<PlaceholderQuest>