simgar98.com

CustomAchievements

CustomAchievements - basics

This page will contain all information necessary to get started with using CustomAchievements


Giving achievements to players

  • By command - Let the console execute a command.
  • Achievement types - Let the player perform a specific action (x times), gets logged after the achievement is created, and gets counted per achievement.
  • Statistics - Let the player do something generic x amount of times server wide, gets logged as soon as CA is added to the server.

By command

Award an achievement to a player with /ach give , remove it with /ach remove

By achievement type

Check out the example achievements.yml and further documentation further down this page.

By statistic

Create an achievement in the achievements.yml with as type STAT, further details further down this page.


The GUI

V1.9.4 got its GUI revamped, no documentation available for earlier versions.


CustomAchievements supports multiple GUIs now, all of which can be found in the data folder in the guis folder. The main GUI that will be opened by default is the main_gui.yml, by default (unless you had an existing configuration before v1.9.4 that got copied over) this is set up as a GUI that just shows how to link to other GUIs. The default secondary_gui.yml shows how to create a gui with multiple pages.

GUIs support two types of items, static and achievement based items. An example of a static item is shown in the main_gui.yml below, for achievement based items look at the secondary_gui.yml further down.
Static items support having an action bound to them, the possible actions are:

  • PREV_PAGE - Opens the previous page.
  • NEXT_PAGE - Opens the next page.
  • OPEN_NEW - Opens a new GUI
  • CLOSE - Closes the GUI/inventory

The main_gui.yml explained

gui:
  title: '&7CustomAchievements' # The title the GUI will have.
  size: 9 # The size of the GUI, should always be a multiple of 9.
nextpage: # The item used to go to the next page.
  slot: -1 # this means it's disabled.
  id: 262
  sub: 0
  name: '&a&l>>'
  lore:
  - '&7Click to go to the'
  - '&7Next page'
prevpage: # The item used to go to the previous page.
  slot: -1 # this means it's disabled.
  id: 262
  sub: 0
  name: '&a&l<<'
  lore:
  - '&7Click to go to the'
  - '&7Previous page'
items: # The items that will be in this GUI.
  '4': # This is the item that will be in slot #4 (slots start counting at 0), the middle.
    item:
      static: # This is a static item, it does not care about your achievement progress or anything, it's always the same for everyone.
        id: 1
        sub: 0
        enchanted: false # Not enchanted (gives a glow)
        name: '&7View achievements'
        lore: 
        - 'Opens the gui with'
        - 'achievements in it!'
        action: 'OPEN_NEW' # The action to execute when a player clicks this item.
        opens: 'secondary_gui' # What GUI to open when clicked (only applicable to the OPEN_NEW action.
  '8':
    item:
      static:
        id: 166
        sub: 0
        enchanted: false
        name: '&4Close this gui'
        lore: []
        action: 'CLOSE' Closes the GUI/Inventory
				

The secondary_gui.yml explained

The secondary_gui is an example of a GUI with actual achievements in it. It also shows how to have multiple pages.

gui:
  title: '&7Second GUI!' # The title of the GUI
  size: 18 #Every page is 2 rows tall, but because it has prev/next only one row is useable.
nextpage:
  slot: 9
  id: 262
  sub: 0
  name: '&a&l>>'
  lore:
  - '&7Click to go to the'
  - '&7Next page'
prevpage:
  slot: 17
  id: 262
  sub: 0
  name: '&a&l<<'
  lore:
  - '&7Click to go to the'
  - '&7Previous page'
items: # The list of items
  '0': # Item at slot 0, inventories start counting at 0!
    item:
      not_unlocked: # The item displayed to the player when they have not yet completed the achievement
        id: 1
        sub: 0
        enchanted: false
        name: '&7Mine 1 stone'
        lore:
        - 'Mine 1 stone'
        - 'to get this achievement!'
        - '{PROGRESSBAR}'
      unlocked: # The item displayed to the player when they have completed the achievement
        id: 4
        sub: 0
        enchanted: true
        name: '&7Mine 1 stone'
        lore:
        - '&2Unlocked'
    achievement: minestone # The achievement defined in achievements.yml
  '1':
    item:
      not_unlocked:
        id: 35
        sub: 14
        enchanted: false
        name: '&7Pick up 1 wool'
        lore:
        - 'Pick up 1 wool'
        - 'to get this achievement!'
        - '{PROGRESSBAR}'
      unlocked:
        id: 35
        sub: 5
        enchanted: false
        name: '&7Pick up 1 wool'
        lore:
        - '&2Unlocked'
    achievement: pickupwool
  '2':
    item:
      not_unlocked:
        id: 351
        sub: 15
        enchanted: false
        name: '&7DIE'
        lore:
        - 'Die once'
        - 'to get this achievement!'
        - '{PROGRESSBAR}'
      unlocked:
        id: 352
        sub: 0
        enchanted: false
        name: '&7DIE'
        lore:
        - '&2Unlocked'
    achievement: die
  '10': # This item is at slot #10, which is on the second page!
    item:
      not_unlocked:
        id: 7
        sub: 0
        enchanted: false
        name: '&7Reach 0,0,0'
        lore:
        - 'Get to x = 0'
        - 'y = 0'
        - 'z = 0 once'
      unlocked:
        id: 7
        sub: 0
        enchanted: true
        name: '&7Reach 0,0,0'
        lore:
        - '&2Unlocked'
    achievement: reach00
				

Achievement types

Achievement types are the main way for players to get achievements. Below is a list and further explanation of every achievement type, and an example usage.

  • STAT
  • BREAK_BLOCK
  • PLACE_BLOCK
  • ITEM_PICKUP
  • ITEM_DROP
  • LOC_REACH
  • KILL_PERM
  • ITEM_CRAFT
  • CUSTOM
  • COMMAND
  • MCMMO Requires McMMO
  • MYTHICMOB Requires MythicMobs

STAT

Required as achievementtype when you want to use statistics (see next block on this page)

die:
  type: STAT
  stattype: DEATHS #the stat type
  amount: 1 #the amount of this stat type
				

BREAK_BLOCK

Gives players this achievement when they break the given amount (default 1) of the given block.

minestone:
  type: BREAK_BLOCK
  item: 
    id: 1 # The Item ID of the block (1 = stone)
    sub: 0 # The Sub-ID/damage of the block (set to false if you don't care)
  amount: 10 # The amount of times this block has to be broken
				

PLACE_BLOCK

See BREAK_BLOCK, just the exact opposite.


ITEM_PICKUP

Gives players this achievement when they pick up the given amount (default 1) of the given item.

pickup10wool:
  type: ITEM_PICKUP
  item: 
    id: 35 # The Item ID of the block (1 = stone)
    sub: false # The Sub-ID/damage of the block (false = dont care)
  amount: 10 # The amount of times this item has to be picked up
				

ITEM_DROP

See ITEM_PICKUP, just the exact opposite.


LOC_REACH

Gives players this achievement when they get close to the given location.

reach00:
  type: LOC_REACH
  place: world,0,1,0 # The location to get to, formatted worldname,x,y,z
  range: 1.0 # The distance the player can be from the location
				

KILL_PERM

Gives players this achievement when they kill a player with a specific permission

kill_owner:
  type: KILL_PERM
  perm: owner.of.server.permission # The permission the victim should have
  amount: 3 # The amount of times they should kill a player with this permission.
				

ITEM_CRAFT

Gives players this achievement when they craft a certain item x amount (default 1) of times

craft_bread:
  type: ITEM_CRAFT
  item: 
    id: 297 # The Item ID of the block (1 = stone)
    sub: 0 # The Sub-ID/damage of the block (false = dont care)
  amount: 9 # The amount of times this item has to be crafted
				

CUSTOM

This is an achievement that does not get automatically given, use this if you want to only have it obtainable by a command! Comes in handy when you want to hook achievements into quests and such!

custom_achievement:
  type: CUSTOM
				

COMMAND

Gives players this achievement when they execute a certain command

go_home:
  type: COMMAND
  cmds: # List of applicable commands
    - '/home'
    - '/essentials:home'
				

MCMMO Requires McMMO

Gives players this achievement when they reach a certain McMMO skill level

10_woodcut:
  type: MCMMO
  skill: EXCAVATION # The relevant skill
  level: 10 # The level which they should get
				

MYTHICMOB Requires MythicMobs

Gives players this achievement when they kill specific MythicMobs mobs.
Tested to work on 1.12 with mythicmobs 4.2.0, no guarantees for 1.8.8 with mythiclibs!

mythic_zombies:
  type: MYTHICMOB
  mobname: MythicZombie # The name of the MythicMob (set in your mythicmobs configuration, not above the mobs head!)
  amount: 10 # The amount to kill
				

Statistics

Statistics get measured from the time the plugin is installed, as long as they are set to true in the log.yml. (by default all are set to true)
They can also be disabled in certain worlds in the log.yml as well

All statistics based achievements follow the following configuration pattern:

achievement_name:
  type: STAT
  stattype: JOINS #the stat type
  amount: 10 #the amount of this stat type
				

List of stattypes

  • JOINS
  • KICKS
  • LEAVES
  • BLOCKS_PLACED
  • BLOCKS_BROKEN
  • MOBS_KILLED - Can have the extra field "mobtype" for specific mobs
  • PLAYERS_KILLED
  • DEATHS
  • TOTAL_LEVELS - Full levels
  • FIRE_ENTITY - Anything from arrows to snowballs
  • ITEM_DROP
  • ITEM_PICKUP
  • ITEM_CRAFT
  • LOCATION - Amount of blocks travelled
  • PLAYTIME - Seconds played on the server
  • MONEY - Current balance
  • VOTES - Requires votifier
  • TAMED - Can also have the extra "mobtype" field
  • FISH_CAUGHT