Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.8] Is it possible to display achievements on client side only? [SOLVED]

Featured Replies

Posted

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.

  • 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.

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.