I have a command block that will be summing sand when conditions are met - and removing sand if the condition is not met.
I thought sand would be the best way to count something - but - now the question is, is there a way to count how much sand is in the spot?
I'm summing the sand way up high, and its falling to land, it can stack to 64 blocks in total, so I need a way to "count" how much sand is vertical in a given location --- how? can it be done? thanks for help, tips, info etc.
You can use CommandStats in order to count the number of blocks to store as a scoreboard value, but in this situation it would be much less complex to simply use scoreboards as a counter to begin with. Quick example:
Well, the issue is that I am trying to make a scoreboard system that was less complex then what I had. I have made Othello (reversi) in minecraft, my first build using a TON of redstone to keep the score, and... sometimes it fails. So I was wanting to come up with a far more simple solution.
The problem is thus; I have 64 blocks to "check" for black or white wool. If it is black, +1 to black, if it is white +1 white, but if it is blank then no one gets anything, issue: I have 1 button that I press that cycles White/Black/Air. So my first build has adding to white, then subtracting from white and adding to black and finally subtracting from black (for when its clear)
The sand idea was to have a block of sand summoned if black is at (X) square, if not black at (X) then remove 1 sand. Same for white. That way I have a 64 tall sand structure that I could, just count and then say "Black is at (X)" score / "White is at (Y) score"
I'll describe how to use CommandStats then, which can count how much sand is in an area.
Command blocks, signs, and entities can hold a set of different "success stats", that will set a player's score depending on the success of the command that is run through that initiator (be it the command block running the command or the entity).
For example: a command block has the command "/testfor @a" and has the "SuccessCount" or "AffectedEntities" CommandStat applied to it. If the /testfor command finds 4 players, the CommandStat will set a player's score to 4.
First you'll need an objective to store a score in:
/scoreboard objectives add BLOCKS dummy
A fake player is going to be used to store the score. In order for CommandStats to function, the target must already be tracked in the objective. A fake player called "SAND" will be used:
/scoreboard players set SAND BLOCKS 0
Now for the main command block. The /clone command will be used to count the number of blocks. What it does is clones the blocks into the same exact position they were in. Visually it does absolutely nothing, but it provides us with the number of blocks cloned (which is equal to the number of sand blocks there are). You'll need to fill in the coordinates ("X1 Y1 Z1" needs to be identical to "x y z"), "masked" is used so it doesn't count air blocks, and "force" has to be used so it can overlap the clone:
/clone X1 Y1 Z1 X2 Y2 Z2 x y z masked force
And finally, the CommandStat to be used. Stand atop the command block and run the following /stats command:
/stats block ~ ~-1 ~ set AffectedBlocks SAND BLOCKS
Every time the command block is activated it's /clone command is run, finds the number of blocks cloned, and the CommandStat will set the "BLOCKS" score of fake player "SAND" equal to the number of blocks cloned.
I have an old video demonstration here (it uses /blockdata to apply the stats, as /stats hadn't been implemented during that time):
cool... that all worked, now how do I get the player "SAND" score to show up and/or use that score to tell my scoreboard blacktotal and whitetotal to whatever SAND =
also, I assume I'm going to need a second SAND for the second set of sandblock stack ---?
that was a ton of info - I had no idea about most of those commands - thanks! now for the last stretch and I should be there! ^_^;;
But... I just don't "get" what I'm looking at no matter what! @_@;
I just want this darn board to function with less redstone then what I've put into it before. Look at the whole board and "count" how much white wool is
output that into "whitetotal" score. Look at how much black wool there is output that as "blacktotal"
please, just... tell me what the commands are exactly, I'm 100% lost
I thought sand would be the best way to count something - but - now the question is, is there a way to count how much sand is in the spot?
I'm summing the sand way up high, and its falling to land, it can stack to 64 blocks in total, so I need a way to "count" how much sand is vertical in a given location --- how? can it be done? thanks for help, tips, info etc.
Creating the objective to track a score:
You can choose to use either a fake player to hold the value or have it increment for real players. I'll use real players just to keep it simple.
For adding:
Subtracting (by ensuring the player's current "COUNTER" score is at least 1, it will not reduce the value to negatives):
If you need to check for a particular value:
The above command will output to a comparator, but only if it finds an online player with a minimum "COUNTER" score of 50.
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/
The problem is thus; I have 64 blocks to "check" for black or white wool. If it is black, +1 to black, if it is white +1 white, but if it is blank then no one gets anything, issue: I have 1 button that I press that cycles White/Black/Air. So my first build has adding to white, then subtracting from white and adding to black and finally subtracting from black (for when its clear)
The sand idea was to have a block of sand summoned if black is at (X) square, if not black at (X) then remove 1 sand. Same for white. That way I have a 64 tall sand structure that I could, just count and then say "Black is at (X)" score / "White is at (Y) score"
@_@;;
Here is the original build:
https://drive.google.com/file/d/0B2PqFy1YZJ2qWk5OTXRaRHdnRXc/view?usp=sharing
Maybe I've just made the whole thing way to complex from the get go. O_o;
blah.
Help?
Command blocks, signs, and entities can hold a set of different "success stats", that will set a player's score depending on the success of the command that is run through that initiator (be it the command block running the command or the entity).
For example: a command block has the command "/testfor @a" and has the "SuccessCount" or "AffectedEntities" CommandStat applied to it. If the /testfor command finds 4 players, the CommandStat will set a player's score to 4.
You can find the CommandStats NBT format here: http://minecraft.gamepedia.com/Chunk_format#Block_entity_format
The type of CommandStat you'll want is "AffectedBlocks". The /stats command allows you to apply different CommandStats to a target: http://minecraft.gamepedia.com/Commands#stats
First you'll need an objective to store a score in:
A fake player is going to be used to store the score. In order for CommandStats to function, the target must already be tracked in the objective. A fake player called "SAND" will be used:
Now for the main command block. The /clone command will be used to count the number of blocks. What it does is clones the blocks into the same exact position they were in. Visually it does absolutely nothing, but it provides us with the number of blocks cloned (which is equal to the number of sand blocks there are). You'll need to fill in the coordinates ("X1 Y1 Z1" needs to be identical to "x y z"), "masked" is used so it doesn't count air blocks, and "force" has to be used so it can overlap the clone:
And finally, the CommandStat to be used. Stand atop the command block and run the following /stats command:
Every time the command block is activated it's /clone command is run, finds the number of blocks cloned, and the CommandStat will set the "BLOCKS" score of fake player "SAND" equal to the number of blocks cloned.
I have an old video demonstration here (it uses /blockdata to apply the stats, as /stats hadn't been implemented during that time):
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/
also, I assume I'm going to need a second SAND for the second set of sandblock stack ---?
that was a ton of info - I had no idea about most of those commands - thanks! now for the last stretch and I should be there! ^_^;;
But... I just don't "get" what I'm looking at no matter what! @_@;
I just want this darn board to function with less redstone then what I've put into it before. Look at the whole board and "count" how much white wool is
output that into "whitetotal" score. Look at how much black wool there is output that as "blacktotal"
please, just... tell me what the commands are exactly, I'm 100% lost