HomeJavaModsAchievementManager (API)
ModsJava

AchievementManager (API)

An easy API used to add custom achievements!. Free Minecraft Java mod for 1.8, 1.9, 1.10.

⬇ Download on Spigot
AchievementManager is an API you can use in order to create custom achievements​

Usage:
Add a dependency to your plugin.yml like this:
Code (Text):
depend: [AchievementManager]
Adding a new achievement (within your code):
Code (Text):

List<String> description = new LinkedList<String>();
description.add(ChatColor.GREEN + "Unlocked by logging in");
description.add(ChatColor.GREEN + "to the server for the");
description.add(ChatColor.GREEN + "very first time!");
AchievementManagerAPI.addAchievement(new Achievement("First Login", description, 10));
 
Example of PlayerAddCustomAchievementEvent:
Code (Text):

@EventHandler
public void achievement(PlayerAddCustomAchievementEvent e) {
Player p = Bukkit.getPlayer(e.getUUID());
if(p == null) return;
p.sendMessage("Unlocked achievement: " + ChatColor.GOLD + e.getAchievement().getName() + ChatColor.WHITE + "!");
}
 
Example of giving an achievement to a player:
Code (Text):

    @EventHandler
    public void join(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        AchievementManagerAPI.addAchievementToPlayer(p.getUniqueId(), Main.getAchievementManager().getAchievementByName("First Login"));
    }
 
Example of a command using the API:
Code (Text):

@Override
public boolean onCommand(CommandSender cs, Command cmd, String cmdLabel, String[] args) {
if(!(cs instanceof Player)) {
cs.sendMessage(ChatColor.RED + "You must be a player to do that!");
return false;
}
Player p = (Player) cs;
if(cmd.getName().equalsIgnoreCase("achievements")) AchievementManagerAPI.openAchievementInventoryToPlayer(p);
return false;
}
 
To-Do List:
- Add MySQL support
- Add a method within the API to get players' achievements points.

AchievementManager (API) is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 159 times (via Spigot). Download it and open it directly in the game.

Explore more