I've looked and can't figure out how to do it, I'm trying to make a Karma system for my map and I want to use the fake players trick. I'm trying to make a good and bad karma system where the player presses a button to get 1 good karma point or presses the other button to get a bad karma point so that if the player looks at the scoreboard on the side it will show their good and bad karma points I already have the scoreboard setup which I named Karma just need to know how to do the other parts.
-
1Can you explain what you mean/want by "fake players"?– MehCommented Jun 10, 2017 at 2:41
-
Like I've seen people use armor stands that are invisible as "fake players" to have more then one like objective line on a scoreboard.– CloverlessRobinCommented Jun 10, 2017 at 2:48
-
So basically another entity which is attached to a player?– MehCommented Jun 10, 2017 at 2:51
-
Yes, I'd like to make it so everytime that button is pressed the "fake player" named Good Karma has its score go up by 1 point– CloverlessRobinCommented Jun 10, 2017 at 2:55
-
I don't think it's possible with your situation. I'm pretty sure that would require you to use a variable in commands, which isn't possible right now (I've encountered that barrier a few times).– MehCommented Jun 10, 2017 at 3:24
4 Answers
Things could have changed drastically since 2017, but since the OP asked about "fake players" I'm surprised by the comment stating "what do you mean fake players?"
It seems common in using commands to store values (aka variables) using the scoreboard command. This could be done 2 ways:
- Create an objective which will store a value for each player and can be manipulated by commands or in-game events. A simple example is "Death Count" or "Zombies Killed".
- Create an objective with the "dummy" criteria which can only be changed by commands.
For 2 to work, you can add "fake players". This way you can have multiple "variables" with separate values, but the in-game mechanic is to essentially have the variables appear on the scoreboard using the scoreboard players...
command. Hence, "fake players". (Player names that start with # do not show up on the scoreboard displayed on the screen).
As per the Scoreboard page on Minecraft Wiki:
Score is only changed by commands, and not by game events such as death. This is useful for event flags, state mappings, currencies,...
I've attached an image of the suggestion by @user191708:
I'm just learning commands now to work with datapacks in 1.15/1.16+ so if anyone can explain it better I'd love suggestions and more knowledge.
This is possible: a fake-player or a variable ist with this makeable:
/scoreboard objectives add KARMA dummy
/scoreboard objectives setdisplay sidebar KARMA
(the score "KARMA" will be show, if one a button is pushed)
Button1:
/scoreboard players add good_karma KARMA 1
Button2:
/scoreboard players add bad_karma KARMA 1
The points will be add not set.
Actually, there are no fake players entities at all. There doesn't need to be. In minecraft, if you reference a player name(e.g. /kill Joe
), it WILL reference the player, regardless if they are in the world(or even exist at all). Usually, this fails with No entity was found
for commands like /kill
which only makes sense if the player is in the world. However, scoreboard displays show up regardless of whether the player exists or not. Therefore, just referece a fake player name is enough, e.g. /scoreboard players add ThisPlayerDoesNotNeedToExistAndItsNameWillBeSshownOnTheScoreboardColumn thing 3
(Note: I've decided to post this answer because none of the other answers make it obvious that "fake players" are not entities)
Same thing as dude above. I just change one thing: I make a scoreboard objective and I give all of my fake players 1, so I can use them in commands by clicking their name, like normal player selectors. It isn’t necessary, but I like to use it if I want the same artificial player to store multiple values from different scoreboards. Hope this can be useful for you in the future.