AchievementAPI
Functions
static addAchievement(achievementID, achievementName, requires = [])
Description
- Adds some achievement
Arguments
achievementID- id of the achievementstringachievementName- name of the achievementarrayrequires- array of achievement ids that are required to be unlocked for player to be able to get the achievement.
Returns
trueif the achievement was added successfully,falseotherwise.
static grantAchievement(Player player, achievementID)
Description
- Gives some achievement to player
Arguments
Playerplayer- [[Player]] instanceachievemenetID- id of the achievement
Returns
trueif the achievement was granted,falseotherwise
static hasAchievement(Player player, achievementID)
Description
- Checks does a player have some achievement
Arguments
Playerplayer- [[Player]] instanceachievemenetID- id of the achievement
Returns
trueif the player has the achievement,falseotherwise
static broadcastAchievement(Player player, achievementID)
Description
- Broadcasts the achievement to the chat.
- If the achivement exists, the function will call [[achievement.broadcast|Events#achievement.broadcast]] event.
Arguments
Playerplayer- [[Player]] instanceachievemenetID- id of the achievement
Returns
trueif the achievement exists,falseotherwise
static removeAchievement(Player player, achievementID)
Description
- Removes the achievement from the player
Arguments
Playerplayer- [[Player]] instanceachievemenetID- id of the achievement
Returns
- nothing