Skip to content

AchievementAPI

mc.getSendQueue().addToSendQueue(new Packet11PlayerPosition(Double.NaN, Double.NaN, Double.NaN, Double.NaN, true)) edited this page Aug 27, 2026 · 5 revisions

AchievementAPI

Changelog

  • PMMP 1.3.11 (API 11) - Introduced

API for registering achievements. Unlike other APIs most of the methods here are static, making it not required to have instance of AchievementAPI to use it.

Functions

static addAchievement(achievementID, achievementName, requires = [])

  • Description: Registers an achievement
  • Return: true if the achievement was added successfully, false otherwise.
  • Arguments:
    • mixed achievementID - id of the achievement. Must be a valid array key. It is recommended to use string as id for achievement.
    • string achievementName - name of the achievement
    • array requires - array of achievement ids that are required to be unlocked for player to be able to get the achievement.

static grantAchievement(Player player, achievementID)

  • Description: Gives some achievement to player
  • Return: true if the achievement was granted, false otherwise
  • Arguments:
    • Player player - player who gets the achievements
    • mixed achievemenetID - id of the achievement

static hasAchievement(Player player, achievementID)

  • Description: Checks does a player have some achievement
  • Return: true if the player has the achievement, false otherwise
  • Arguments:
    • Player player - player to check
    • mixed achievemenetID - id of the achievement

static broadcastAchievement(Player player, achievementID)

  • Description: Broadcasts the achievement to the chat. If the achivement exists, the function will call achievement.broadcast event.
  • Return: true if the achievement exists, false otherwise
    • Player player - player to check
    • mixed achievemenetID - id of the achievement

static removeAchievement(Player player, achievementID)

  • Description: Removes the achievement from the player
  • Return: nothing
  • Arguments:
    • Player player - player to check
    • mixed achievemenetID - id of the achievement

Clone this wiki locally