Posted May 31, 201510 yr I know this is a strange question, but it is related to a requested mod from one of the Moderators of a server i play on. Is it possible to display an Achievement to the client side only? Not actually adding an achievement, but display one anyways? Something along the lines of thePlayer.Triggerachievement("Wow, you installed a mod.") From my searching i've found server side mods that do this, but this needs to be entirely client side.
May 31, 201510 yr Author Ok so with this code in a keybind i can get the achievement to display, a second press crashes the game. Achievement ach; ach = new Achievement("achievement.LazyCheater", "LazyCheater", 0, 0, Blocks.command_block, (Achievement)null).func_180788_c(); AchievementPage.registerAchievementPage(new AchievementPage("Troll", new Achievement[]{ach})); Minecraft.getMinecraft().guiAchievement.displayAchievement(ach); If i place this part in the Init portion Achievement ach; ach = new Achievement("achievement.LazyCheater", "LazyCheater", 0, 0, Blocks.command_block, (Achievement)null).func_180788_c(); AchievementPage.registerAchievementPage(new AchievementPage("Troll", new Achievement[]{ach})); And this part in the keybind Minecraft.getMinecraft().guiAchievement.displayAchievement(ach); I get an error in code, where ach can't be resolved. Basically what i'm wanting to happen is that every time a player goes into gamemode 1, they get this achievement. So if they did gm 1, gm 0, gm 1, they would get the achievement display twice.
May 31, 201510 yr Author Ok so here's the working source, in case someone else wants to know how to do this. Put this in your main mod file. @EventHandler public void init(FMLInitializationEvent event){ ach = new Achievement("achievement.LazyCheater", "LazyCheater", 0, 0, Blocks.command_block, (Achievement)null).func_180788_c(); AchievementPage.registerAchievementPage(new AchievementPage("Troll", new Achievement[]{ach})); } public static Achievement ach; Then place this code where you want the Achievement to display. Minecraft.getMinecraft().guiAchievement.displayAchievement(yourmainmod.ach);
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.