How to count achievements after the game started?

How to count achievements after the game started? - Ethnic boy solving mathematical example made of toy numbers

I have a Minecraft server with a couple friends on it. I was thinking of using the scoreboard function to track achievements so we could know each other's progression in the game. Problem being that the server has already been on for quite awhile and people have accumulated achievements already.

Is there a command in game to list number of achievements obtained or perhaps in the statistics of a player? This is then used to update the scoreboard with the starting values and then further track from then on.

MC version: 1.7.10 Modpack: FTB Resurrection



Best Answer

The scoreboard command is big and complicated. Go look at the wiki article for it first.

So, the first thing you need to do is set up a scoreboard objective for each achievement:

/scoreboard objective add acquireIron achievement.acquireIron
/scoreboard objective add bakeBread achievement.bakeBread
...

See the wiki for each of the achievements in vanilla Minecraft. Note that Overpowered probably isn't available, since it was added in 1.8, and some mods can add other achievements.

You'll also need a a scoreboard objective to tally all the other achievements:

/scoreboard objective add tally dummy Achievments Taken

Now you'll need a clock, probably a fill clock, although not necessarily a 20Hz fill clock. You'll need a clock that can trigger over 30 command blocks.

There's probably a better way to do the next step on a brand new server, but since that's not the case, I won't go into it. The first command that needs to be run on each clock cycle is a reset of everyone's tally score:

scoreboard players set @a tally 0

Next we need to increment the tally score for each achievement taken:

scoreboard players add @a[score_acquireIron_min=1] tally 1
scoreboard players add @a[score_bakeBread_min=1] tally 1
...

That's it for commands that need to be run on a clock. The only important thing is that the tally score gets reset first, and that every achievement score is checked before the tally score gets reset again.

Finally, you need some way to display this to the server. I would suggest the tab list:

/scoreboard objective setdisplay list tally

Disclaimer: I haven't tested this myself, as I'm away from my desktop computer and a Minecraft installation. I'm pretty sure I haven't missed anything obvious, so this should work fine.




Pictures about "How to count achievements after the game started?"

How to count achievements after the game started? - Crop anonymous ethnic boy taking plastic number from wooden table while learning math
How to count achievements after the game started? - Blond little girl standing while playing with puzzle in living room at home and counting sticks different colors during weekend
How to count achievements after the game started? - Athletes Running on Track and Field Oval in Grayscale Photography





Where Did Achievements Come From?




More answers regarding how to count achievements after the game started?

Answer 2

If you're using advancements pack by BlazeandCav, you can enter those commands

You can get the scoreboard to show up on the sidebar using the following command:

/scoreboard objectives setdisplay sidebar Advancements

Or on the player list that shows up when you press tab:

/scoreboard objectives setdisplay list Advancements

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Keira Burton, Keira Burton, Gustavo Fring, Pixabay