AdvancementRewards 1.0

Gives a reward to the first player to complete an advancement

  1. jbko6
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.16
    This is an extremely lightweight plugin that grants rewards to the first player to complete an advancement. This plugin is perfect if you are just starting a world with your friends and want to bring in a little competition into the mix.

    You can customize which advancement you want to grant an award for and what the award should be in the config file.

    Here's what the config file should look like
    Code (YAML):
    # Plugin by Jbko6

    Advancements
    :
      ADVANCEMENT NAMESPACE
    :  # See below for what this is
        REWARD
    :
          ==
    : org.bukkit.inventory.ItemStack   # Don't change this
          v
    : 2580   # Don't change this
          type
    : ITEM     # This is the item you want to be rewarded. It should be a material. See all materials at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
          amount
    : AMOUNT   # This is pretty self-explanatory. How many items should be given.
        PLAYER
    :   # This space should be kept empty be default. It will store who first got the advancement.
     
    The area called "ADVANCEMENT NAMESPACE" is a little bit confusing if you don't have much knowledge about how Minecraft accesses resources. The namespace is pretty much a path to a file. For advancements that path usually looks something like "minecraft:folder/advancement". You can see all of Minecraft's advancements and figure out their namespaces by extracting the 1.16.3 jar, located in the versions file of Minecraft's appdata.
    Here's the path:
    Code (Text):
    AppData > Roaming > .minecraft > versions > 1.16.3 > 1.16.3.jar > data > minecraft > advancements
    What's great about using namespace's is that this plugin will actually work with custom advancements too! Simply change out the "minecraft:" for the datapack's namespace and then add the path as the path to the custom json file for that advancement.

    I've created a list of all the main advancements and their namespaces here if you are too lazy to search through the game files:
    https://pastebin.com/wYgimE8R
    Keep in mind that many advancements are missing from this list.

    Here's an example of what the config file should look like if it was configured properly
    Code (YAML):
    # Plugin by Jbko6

    Advancements
    :
      minecraft:story/mine_stone
    :
        REWARD
    :
          ==
    : org.bukkit.inventory.ItemStack
          v
    : 2580
          type
    : FURNACE
          amount
    : 1
        PLAYER
    :
      minecraft:story/smelt_iron
    :
        REWARD
    :
          ==
    : org.bukkit.inventory.ItemStack
          v
    : 2580
          type
    : COAL
          amount
    : 64
        PLAYER
    :
      minecraft:story/iron_tools
    :
        REWARD
    :
          ==
    : org.bukkit.inventory.ItemStack
          v
    : 2580
          type
    : IRON_INGOT
          amount
    : 10
        PLAYER
    :

    If you've configured everything accordingly, the first player to complete that advancement will receive whatever reward is specified, fireworks will go off, a sound will play, and this message will be sent to everyone in chat
    [​IMG]

    I apologize if this explanation of how to make my plugin function is confusing, I'm very bad at explaining things. In addition, the plugin is not very user friendly because I made it with myself in mind and didn't really plan on sharing it like I'm doing now.

    Let me know if you have any problems or questions and I'll try to answer them as fast as I can.