Bounty Challenges - No-Not-Jaden/NotBounties GitHub Wiki

Bounty Challenges is a feature that can reward players for completing bounty related quests. Challenges will rotate randomly every once in a while, and players can attempt new ones. By default, this feature is disabled. You can enable it as well as configure the feature in the plugins/NotBounties/challenges/challenges.yml file.

How it works

With challenges enabled, players will have access to the /bounty challenges command and can view the challenges GUI. This GUI can be configured in the gui.yml file. You can view how to edit the GUI here. This GUI will show the currently active challenges in the player-slots section. The available challenges can be configured in the challenges.yml file. A few of the configured challenges will be randomly selected and assigned to everyone. The players can complete these challenges and redeem rewards. After a set amount of time, these will change to another set of randomly selected challenges.

Global Configuration

The global configuration is located at the top of the challenges.yml file and consists of options that effect all challenges.

Challenge Cycle Time

The time-limit-days option controls how often challenges cycle in days. Challenges reset at the same time for everyone.

# The time limit that players have to complete the challenges before new ones appear
time-limit-days: 7

Concurrent Challenges

The concurrent-challenges option controls how many challenges will be active at a time. If you increase this, you must add a new player slot in the challenges GUI for it to be displayed.

# number of challenges that will be active
concurrent-challenges: 3

Global Challenges

The global-challenges options controls if everyone has the same challenges (true) or if everyone gets different challenges (false).

# whether everyone has the same
global-challenges: true

Challenge Type Configuration

The challenge configuration is below the global configuration in the challenge-types section and controls the specifics for each challenge. The available challenge types are:

  • Claim bounties (claim)
  • Set bounties for a certain amount (amount-set)
  • Have one of your set bounties be claimed (successful-bounty)
  • Increase your bounty by a scalar amount (bounty-multiple)
  • Increase your bounty by a flat amount (bounty-increase)
  • Buy immunity (purchase-immunity)
  • Be near a claimed bounty (witness-bounty-claim)
  • Set a whitelisted bounty (whitelisted-bounty-set)
  • Hold your own bounty poster (hold-poster)
  • Have a bounty set on you by the console/sheriff (auto-bounty)
  • Have a certain number of people set a bounty on you (receive-bounty)
  • Claim a bounty without armor (naked-bounty-claim)
  • Claim a bounty with 2 hearts or fewer left (close-bounty)
  • Buy your own bounty (buy-own)
  • Custom challenges with a placeholder

Some challenges will not be enabled if their base feature isn't enabled. For example, if whitelists are disabled, then you cannot get the whitelisted-bounty-set challenge.

Configuring a Challenge

This is an example of a fully configured challenge for the claim challenge:

  # Claim a certain number of bounties
  claim:
    # info about the item displayed in the GUI. This is the same formatting as custom items in the gui.yml file.
    # The in-progress and completed sections control the name and lore
    item:
      # material from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
      # can also be a custom head like in the gui
      material: DIAMOND_SWORD
      amount: 1
      # for resource packs. Not required to use this
      custom-model-data: 5
      enchanted: false
      hide-nbt: true
    # The component displayed in the bedrock GUI
    # The first line of in-progress and completed sections control the text
    bedrock-item:
      type: BUTTON
      # You can optionally add an image next to this button
      image: 'textures/items/diamond_sword.png'
      image-url: false
    # display of challenge before it has been completed
    in-progress:
      - '&e&lClaim &f&l{x} &e&lBounties' # this first line is the name of the item in the GUI
      - '&7<&m                            &7>'
      - '&6&oKill {x} players with any bounty.'
      - '&7<> ({progress_value}) {progress_bar} <>'
      - '&6&oReward: {reward} Diamonds.'
      - '&7<&m                            &7>'
    # display of challenge after it has been completed
    completed:
      - '&a&l&mClaim {x} Bounties'
      - '&7<&m                            &7>'
      - '&2&oChallenge Completed'
      - '&7<&m                            &7>'
    # different variations of the challenge
    # {x} is replaced in the description with the variation
    # in this case, the variations are the number of bounties to be claimed
    variations:
      - 1 # This challenge could be 1 to 3 bounties
      - 2
      - 3
    # the reward of the challenge
    # If the reward option is a single number, then it is a multiplier on the variation
    reward: 3
    # If the reward is a list like below, each line is a reward for each variation
    # reward:
    #  - 3
    #  - 6
    #  - 9
    commands:
      # This command hands out the reward
      - 'minecraft:give {player} diamond {reward}'
      # These commands give a little feedback to the player once they claim the reward
      - '[message_player] &aYou''ve completed the challenge: {challenge}'
      - '[sound] UI_TOAST_CHALLENGE_COMPLETE'

More detail on the configuration can be seen below

Challenge Type

The configuration section specifies which challenge is being configured. In the example above, claim is the challenge being configured. The configuration section names are in parenthesis where the challenge types are listed. For a custom challenge, see below

Item and Bedrock Item

The item and bedrock-item sections allows you to create a display item and component for this challenge that shows up in the java and bedrock GUI. It is basically the same as configuring a custom item in the gui.yml file for the java item, and configuring a component in the bedrock-gui.yml file for the bedrock component. The only difference is that any text (name/lore) will be configured in a different area.

    # info about the item displayed in the GUI. This is the same formatting as custom items in the gui.yml file.
    # The in-progress and completed sections control the name and lore
    item:
      # material from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
      # can also be a custom head like in the gui
      material: DIAMOND_SWORD
      amount: 1
      # for resource packs. Not required to use this
      custom-model-data: 5
      enchanted: false
      hide-nbt: true
    # The component displayed in the bedrock GUI
    # The first line of in-progress and completed sections control the text
    bedrock-item:
      type: BUTTON
      # You can optionally add an image next to this button
      image: 'textures/items/diamond_sword.png'
      image-url: false

In Progress and Completed Text

The in-progress and completed text control what the GUI item displays when the challenge is uncompleted or completed. For the java item, the first line in each list will be used as the item name, and the rest will be used as the lore. You can use PlaceholderAPI placeholders here, and some special NotBounties placeholders as described:

  • {x} will be replaced with the variation, or the number that the player has to hit to complete the challenge. The number that replaces this can be configured.
  • {reward} will be replaced with a number representing the quantity of their reward. The number that replaces this can be configured.
  • {progress} will be replaced with the percent completion for this challenge.
  • {progress_bar} will be replaced with a text based progress bar representing the completion.
  • {progress_bar_[x]} will be replaced with a progress bar where [x] is the number of characters in the bar.
  • {progress_value} will be replaced with "(current)/(total)" where current is the current actions completed, and total is the required actions to be completed to finish the challenge.
  • {start} will be replaced with the starting player statistic for this challenge.
  • {current} will be replaced with the current player statistic for this challenge.
  • {total} will be replaced with the required player statistic to completed this challenge.
  • {progress_raw} is just like {progress_value} except the values aren't relative to when this challenge started. It is the same as {current}/{total}
    # display of challenge before it has been completed
    in-progress:
      - '&e&lClaim &f&l{x} &e&lBounties' # this first line is the name of the item in the GUI
      - '&7<&m                            &7>'
      - '&6&oKill {x} players with any bounty.'
      - '&7<> ({progress_value}) {progress_bar} <>'
      - '&6&oReward: {reward} Diamonds.'
      - '&7<&m                            &7>'
    # display of challenge after it has been completed
    completed:
      - '&a&l&mClaim {x} Bounties'
      - '&7<&m                            &7>'
      - '&2&oChallenge Completed'
      - '&7<&m                            &7>'

Variations and Reward

The variations section control how many actions are required to complete the challenge. When challenges are selected for the player, a random variation is picked. The reward section controls what the {reward} placeholder is replaced with. If there is only a single number set for the reward, then that number is multiplied by the variation before replacing {reward}. If the reward section holds a list, then the index of the reward that replaces {reward} will be the same index of the variation selected.

    # different variations of the challenge
    # {x} is replaced in the description with the variation
    # in this case, the variations are the number of bounties to be claimed
    variations:
      - 1 # This challenge could be 1 to 3 bounties
      - 2
      - 3
    # the reward of the challenge
    # If the reward option is a single number, then it is a multiplier on the variation
    reward: 3
    # If the reward is a list like below, each line is a reward for each variation
    # reward:
    #  - 3
    #  - 6
    #  - 9

Commands

The commands section holds commands that will be run when the player completes the challenge. This is where the rewards are given to the player. Action Commands can be used here along with the {x} and {reward} placeholders. The {challenge} placeholder is exclusive to this section and will be replaced with the title of the challenge which is the first line of the completed list.

    commands:
      # This command hands out the reward
      - 'minecraft:give {player} diamond {reward}'
      # These commands give a little feedback to the player once they claim the reward
      - '[message_player] &aYou''ve completed the challenge: {challenge}'
      - '[sound] UI_TOAST_CHALLENGE_COMPLETE'

Custom Challenges

Custom challenges can be configured in the custom-challenges configuration section and require PlaceholderAPI. These are configured almost exactly the same as the other challenges except there is a requirement option. This is a string of text that must be in the format:

requirement: '%placeholder% operator value'
  • %placeholder% is the placeholder from PlaceholderAPI that you want to use.
  • value is the value that you are comparing with the placeholder.
  • operator compares the placeholder and value. (!=,=,>=,<=,>,<)

Examples include %nottokens_tokens% != 0 and %Advancements_nether/return_to_sender% = true

# Create custom challenges with placeholders. Requires PlaceholderAPI
  custom-challenges:
    # this configuration section can be named whatever
    set-bounty:
      item:
        material: NETHERITE_SWORD
        hide-nbt: true
      bedrock-item:
        type: BUTTON
        image: 'textures/items/netherite_sword.png'
        image-url: false
      # player must increase this stat by {x}
      requirement: '%notbounties_set% >= {x}'
      # display of challenge before it has been completed
      in-progress:
        - '&e&lSet {x} Bounties'
        - '&7<&m                            &7>'
        - '&6&oSet {x} Bounties'
        - '&7<> ({progress_value}) {progress_bar} <>'
        - '&6&oReward: {reward} Ancient Debris.'
        - '&7<&m                            &7>'
      # display of challenge after it has been completed
      completed:
        - '&a&l&mBuy your own Bounty'
        - '&7<&m                            &7>'
        - '&2&oChallenge Completed'
        - '&7<&m                            &7>'
      variations:
        - 1
        - 2
        - 3
      reward: 1
      commands:
        - 'minecraft:give {player} ancient_debris {reward}'
        - '[message_player] &aYou''ve completed the challenge: {challenge}'
        - '[sound] UI_TOAST_CHALLENGE_COMPLETE'