Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Adding new categories

Pierre-Yves B edited this page Sep 26, 2020 · 6 revisions

Adding simple categories directly in Advanced Achievements is really easy and does not require advanced Java knowledge: it's mostly a matter of following the code that's already written!

  • Define a new category by adding a value to the NormalAchievements.java enum in the com.hm.achievement.category package. For instance:
    CATEGORYNAME("CategoryNameInConfigs", "lang-key-for-aach-list", "Default display name", "Comment in config.yml"),
  • Add a new listener class to the com.hm.achievement.listener.statistics package. DropsListener.java is a very simple example you can use as a reference.
  • Add a new binding method in ReloadableModule.java, similar to the existing ones.
  • Add a new default permission value in plugin.yml (achievement.count. followed by the category name in lower case). This file is situated in the resources folder.
  • Still in the resources folder, update config.yml, lang.yml and gui.yml to include your new category. You're done!

If you're happy with what you've done, why not contribute and open a pull request?