There's a huge issue with activating commands blocks that rely on one another at the same time, which is why the separation was needed. It's to do with the Java hash set, which as explained by Seth at one point in detail. More than one command block cannot be activated "at the same time". When they are, one runs its command before the other one does. The order in which this occurs is, needless to say, unreliable and/or complex. If the mob kill count deduction occurs first, then the coins incrementation doesn't have a player to select.
What you say is true in that there's a chance a player will not get their coins. There are more reliable methods, but they increase the size of the mechanism greatly, to the point of not being worthwhile unless you absolutely need it to be as accurate as possible (and even then, it's not necessarily accurate).
The use of a /testfor makes no difference in the outcome. The mechanism I showed works perfectly in singleplayer as well, just not as accurately in multiplayer.
I have a question. I see the hoppers being used a lot for ticks. How does that work? I cannot get them to cause the tick, do you have to put items inside? What's the trick?
I have a question. I see the hoppers being used a lot for ticks. How does that work? I cannot get them to cause the tick, do you have to put items inside? What's the trick?
It's a 3-step process. You place a block/hopper down first, and then target one of the sides of the block and place a hopper against it. The hopper will "point" into the block, like so:
The hopper on the right shows what I'm talking about. I included a hopper shown on the left that shows the default placement. Then you just need to place a hopper against the same side as the hopper on the right, so the hoppers point into one another. You place a single item in only one of those hoppers and they will automatically transfer back and forth:
Hopper clocks are popular due to their lack of lag produced, as compared to a comparator or other redstone-based clock. They're not ideal for speed, so sometimes a faster clock will be necessary.
There's a huge issue with activating commands blocks that rely on one another at the same time, which is why the separation was needed. It's to do with the Java hash set, which as explained by Seth at one point in detail. More than one command block cannot be activated "at the same time". When they are, one runs its command before the other one does. The order in which this occurs is, needless to say, unreliable and/or complex. If the mob kill count deduction occurs first, then the coins incrementation doesn't have a player to select.
What you say is true in that there's a chance a player will not get their coins. There are more reliable methods, but they increase the size of the mechanism greatly, to the point of not being worthwhile unless you absolutely need it to be as accurate as possible (and even then, it's not necessarily accurate).
The use of a /testfor makes no difference in the outcome. The mechanism I showed works perfectly in singleplayer as well, just not as accurately in multiplayer.
True enough, I get how that works. So let's continue our system of trial and error an try this:
Create a new objective:
/scoreboard objectives add gotCreeperCoin dummy
Then have a command block on top of the RIGHT one saying
scoreboard players set @a[score_creeperKills_min=1] gotCreeperCoin 1
Then add
score_gotCreeperCoin_min=1
as a parameter to the scoreboard command on the one to the LEFT, and put one above it taking the gotCreeperCoin away from the players with it.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
scoreboard players set @a[score_receivedCreeperCoin_min=1] receivedCreeperCoin 0
This still runs into the issue I explained earlier consisting of activating command blocks at the same time. Your two command blocks on the left rely on each other. If the top-left one happens to activate before the bottom-left, the bottom-left won't do anything. A delay is needed to ensure which command blocks is activated first, otherwise you're running blind. As the game changes, so may the result of such a setup; it's not a good idea to rely on activating command blocks at the same time when they rely on one another.
This still runs into the issue I explained earlier consisting of activating command blocks at the same time. Your two command blocks on the left rely on each other. If the top-left one happens to activate before the bottom-left, the bottom-left won't do anything. A delay is needed to ensure which command blocks is activated first, otherwise you're running blind. As the game changes, so may the result of such a setup; it's not a good idea to rely on activating command blocks at the same time when they rely on one another.
Darn I forgot about that part! Well I guess there isn't yet a fool proof way than. Right now I use that tactic, and switch the command blocks around if it's not working.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
Ok, I've got a pretty big problem. When I use the hopper method, it will on occassion add extra blocks in, preventing the clock from working. So basically, I put in 1 piece of gravel. A few days later, there are now 4 pieces of gravel where there was once only one. Has this happened to anyone else when using the clock for a scoreboard?
Ok, I've got a pretty big problem. When I use the hopper method, it will on occassion add extra blocks in, preventing the clock from working. So basically, I put in 1 piece of gravel. A few days later, there are now 4 pieces of gravel where there was once only one. Has this happened to anyone else when using the clock for a scoreboard?
Unless you are summoning gravel, or gravel is breaking near-by, I don't see why that would be happening. Try using a different item and see if it's just gravel for some reason.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
it's been happening with everything I put in it. It's nuts.
I've read about some people having this issue as well. I don't know if this would fix it, but it sounds like it should: check if your hoppers are in two different chunks. If one hopper is being unloaded before the other, this may be causing your issue. You'd have to move them into the same chunk, but if that's not your issue, then I'm not sure what to say; I've never come across this myself.
This still runs into the issue I explained earlier consisting of activating command blocks at the same time. Your two command blocks on the left rely on each other. If the top-left one happens to activate before the bottom-left, the bottom-left won't do anything. A delay is needed to ensure which command blocks is activated first, otherwise you're running blind. As the game changes, so may the result of such a setup; it's not a good idea to rely on activating command blocks at the same time when they rely on one another.
So sorry I didn't get to 1.8 today, but MCForum switched me to HTML code which doesn't load on the OP. If anyone knows how to contact a member of curse, explaining this bug to them is appreciated as it is very toilsome to delete all the HTML code it inserts
Anyways, I'll do my best to learn a little more about the new 1.8 scoreboard mechanics today, and fill in my findings today and tomorrow. Remember if you have any questions I'll do my best to answer them.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
Is it possible to only display the scoreboard whenever someone has updated their score? My idea is for a death counter that displays for a few seconds every time someone dies.
Is it possible to only display the scoreboard whenever someone has updated their score? My idea is for a death counter that displays for a few seconds every time someone dies.
Expand on this a little bit more. Do you want a deathscore sidebar that only shows players who have died recently?
If so, try this. First create a deathCount objective.
/scoreboard objectives add oneDeath deathCount
Then create a dummy objective to display on the sidebar when they die
Whenever someone dies, they will appear on the sidebar labeled Newly_Dead to the right with a score of 10. Every second their number will decrease by one, and when it reaches 0, they will disappear. If this is not what you wanted, explain what's wrong and I'll try to fix it. If you need help with a very fast clock, or a one second clock, ask and I'll bring up some pictures.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
That is interesting and I might make use of it. In fact, I think I might see a way to use that to build towards my goal.
I was looking more for displaying the scoreboard for Deaths for a few seconds after every death and have it show current death count.
I'll give it a shot tonight.
That is interesting and I might make use of it. In fact, I think I might see a way to use that to build towards my goal.
I was looking more for displaying the scoreboard for Deaths for a few seconds after every death and have it show current death count.
I'll give it a shot tonight.
Wait so you want the entire board to display when one person dies? If so, try this:
First create a new objective
/scoreeboard objectives add totalDeath deathCount
Then the same objectives above, but do this instead. Have a fact clock be running this command
Have that activate an inverter, which should trigger this command block
scoreboard objectives setdisplay sidebar
If you need any help with this, or if I got it wrong again, let me know. If you want I can build the machine to do this, and show some pictures, and label which command goes where, but it might be a while. I may not be able to get to the computer later today.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
I'm working on a version of Star Wars Battlefront 2 for Minecraft. I want to have one team, Republic use blue for the team color. The other team CIS will be red. Also, I want to have 100 lives for each side and the sidebar would say how many lives for each team are remaining (each time someone dies, the score goes down until one team has 0 slots left). is there any way to program the scoreboard to do this?
I'm working on a version of Star Wars Battlefront 2 for Minecraft. I want to have one team, Republic use blue for the team color. The other team CIS will be red. Also, I want to have 100 lives for each side and the sidebar would say how many lives for each team are remaining (each time someone dies, the score goes down until one team has 0 slots left). is there any way to program the scoreboard to do this?
Absolutely. First create two objectives, life and death
/scoreboard objectives add death deathCount
/scoreboard objectives add life dummy
Assign life to the sidebar
/scoreboard objectives setdisplay sidebar life
We can't display team scores, so we'll use player names to represent the teams. Assign a player named "Republic" to the Republic team, and a player named "CIS" to the CIS team. These player do not need to be on the world, but you'll need to use 1.8 to be able to test their values if they're not.
/scoreboard teams join (Team name) (Player name)
Next give each "team player" 100 life points
/scoreboard players set Republic life 100
/scoreboard players set CIS life 100
Now you've got the setup, let's work on some mechanics. There are several ways to do this part, I'll show the simplest. To detect when someone dies, you'll have a fairly slow clock, two tick at fastest, running this command.
/scoreboard players remove @r[team_Republic,death_min=1] death 1
Have a comparator leading out of this. be sure to put a redstone torch on the command block that locks the repeater whenever it's activated, which i can show you how to do if you want. The comparator will lead to this.
scoreboard players remove Republic life 1
Then, using 1.8, have a clock running this command with an inverted output
scoreboard players test Republic life 1
That comparator will run into a machine that ends the game and says CIS wins. If you need help setting it up, I'll be happy to post some pictures! But please be patient if they don't come right away, I'm quite busy at the moment.
Rollback Post to RevisionRollBack
Quote me to get a quicker response! If I helped you in any way, please click the reputation square!
Absolutely. First create two objectives, life and death
/scoreboard objectives add death deathCount
/scoreboard objectives add life dummy
Assign life to the sidebar
/scoreboard objectives setdisplay sidebar life
We can't display team scores, so we'll use player names to represent the teams. Assign a player named "Republic" to the Republic team, and a player named "CIS" to the CIS team. These player do not need to be on the world, but you'll need to use 1.8 to be able to test their values if they're not.
/scoreboard teams join (Team name) (Player name)
Next give each "team player" 100 life points
/scoreboard players set Republic life 100
/scoreboard players set CIS life 100
Now you've got the setup, let's work on some mechanics. There are several ways to do this part, I'll show the simplest. To detect when someone dies, you'll have a fairly slow clock, two tick at fastest, running this command.
/scoreboard players remove @r[team_Republic,death_min=1] death 1
Have a comparator leading out of this. be sure to put a redstone torch on the command block that locks the repeater whenever it's activated, which i can show you how to do if you want. The comparator will lead to this.
scoreboard players remove Republic life 1
Then, using 1.8, have a clock running this command with an inverted output
scoreboard players test Republic life 1
That comparator will run into a machine that ends the game and says CIS wins. If you need help setting it up, I'll be happy to post some pictures! But please be patient if they don't come right away, I'm quite busy at the moment.
Sorry, I don't think I explained what I need very well. I want to have 100 lives for each team. Each time a player dies, the life count for the team that they are on goes down by one. When that 100 goes to 0, the game ends. Is that a better explanation?
I have a question. I see the hoppers being used a lot for ticks. How does that work? I cannot get them to cause the tick, do you have to put items inside? What's the trick?
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
It's a 3-step process. You place a block/hopper down first, and then target one of the sides of the block and place a hopper against it. The hopper will "point" into the block, like so:
The hopper on the right shows what I'm talking about. I included a hopper shown on the left that shows the default placement. Then you just need to place a hopper against the same side as the hopper on the right, so the hoppers point into one another. You place a single item in only one of those hoppers and they will automatically transfer back and forth:
Hopper clocks are popular due to their lack of lag produced, as compared to a comparator or other redstone-based clock. They're not ideal for speed, so sometimes a faster clock will be necessary.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Create a new objective:
Then have a command block on top of the RIGHT one saying
Then add
as a parameter to the scoreboard command on the one to the LEFT, and put one above it taking the gotCreeperCoin away from the players with it.
Could you show this?
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
http://imgur.com/BotgRnG
Bottom right:
Top right:
Bottom left:
Top left:
This still runs into the issue I explained earlier consisting of activating command blocks at the same time. Your two command blocks on the left rely on each other. If the top-left one happens to activate before the bottom-left, the bottom-left won't do anything. A delay is needed to ensure which command blocks is activated first, otherwise you're running blind. As the game changes, so may the result of such a setup; it's not a good idea to rely on activating command blocks at the same time when they rely on one another.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
I've read about some people having this issue as well. I don't know if this would fix it, but it sounds like it should: check if your hoppers are in two different chunks. If one hopper is being unloaded before the other, this may be causing your issue. You'd have to move them into the same chunk, but if that's not your issue, then I'm not sure what to say; I've never come across this myself.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
I believe to have solved the problem! The only unfortunate part is that it uses three objectives.
The hopper activates three command blocks:
and
like normal, but also
Then a comparator runs out of either of the first two command blocks triggering these two:
and
Then a repeater feeds out of either one, as long as it can receive power from the comparator, feeding into a command block:
Anyways, I'll do my best to learn a little more about the new 1.8 scoreboard mechanics today, and fill in my findings today and tomorrow. Remember if you have any questions I'll do my best to answer them.
Expand on this a little bit more. Do you want a deathscore sidebar that only shows players who have died recently?
If so, try this. First create a deathCount objective.
Then create a dummy objective to display on the sidebar when they die
Next set up a very fast clock. The first command block it should activate should say
The next one should be
And finally:
Then a one-second clock:
What this will do:
Whenever someone dies, they will appear on the sidebar labeled Newly_Dead to the right with a score of 10. Every second their number will decrease by one, and when it reaches 0, they will disappear. If this is not what you wanted, explain what's wrong and I'll try to fix it. If you need help with a very fast clock, or a one second clock, ask and I'll bring up some pictures.
I was looking more for displaying the scoreboard for Deaths for a few seconds after every death and have it show current death count.
I'll give it a shot tonight.
Wait so you want the entire board to display when one person dies? If so, try this:
First create a new objective
Then the same objectives above, but do this instead. Have a fact clock be running this command
Have that activate two command blocks
Next, have a 1-second clock. Again, I'll be happy to help you with the clocks, it will trigger:
Have that activate an inverter, which should trigger this command block
If you need any help with this, or if I got it wrong again, let me know. If you want I can build the machine to do this, and show some pictures, and label which command goes where, but it might be a while. I may not be able to get to the computer later today.
I'm working on a version of Star Wars Battlefront 2 for Minecraft. I want to have one team, Republic use blue for the team color. The other team CIS will be red. Also, I want to have 100 lives for each side and the sidebar would say how many lives for each team are remaining (each time someone dies, the score goes down until one team has 0 slots left). is there any way to program the scoreboard to do this?
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
Absolutely. First create two objectives, life and death
Assign life to the sidebar
We can't display team scores, so we'll use player names to represent the teams. Assign a player named "Republic" to the Republic team, and a player named "CIS" to the CIS team. These player do not need to be on the world, but you'll need to use 1.8 to be able to test their values if they're not.
Next give each "team player" 100 life points
Now you've got the setup, let's work on some mechanics. There are several ways to do this part, I'll show the simplest. To detect when someone dies, you'll have a fairly slow clock, two tick at fastest, running this command.
Have a comparator leading out of this. be sure to put a redstone torch on the command block that locks the repeater whenever it's activated, which i can show you how to do if you want. The comparator will lead to this.
Then, using 1.8, have a clock running this command with an inverted output
That comparator will run into a machine that ends the game and says CIS wins. If you need help setting it up, I'll be happy to post some pictures! But please be patient if they don't come right away, I'm quite busy at the moment.
Sorry, I don't think I explained what I need very well. I want to have 100 lives for each team. Each time a player dies, the life count for the team that they are on goes down by one. When that 100 goes to 0, the game ends. Is that a better explanation?
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/