1
Command Block Chain and Scoreboard
I have a series of command block that work fine until the last block.
I have five in the chain
1. Testforblock - repeat unconditional always active
2. Setblock - chain conditional always active
3. Setblock - chain conditional always active
4. Testforblock - chain conditional always active
5. Scoreboard - chain conditional always active
The first four run fine but the last one never runs and I'm starting to think this is because it affects the scoreboard but I'm pretty certain you can change the scoreboard from a command block (as I have done this with placing a button that block and setting it to impulse). The command itself runs fine when I type it in or run the block on a button but when it's in the chain it doesn't work.
The block before I know is running fine as it tells me that and its basically doing a similar thing as the first one is doing.
The command for the last two blocks are
/testforblock -49 74 -1 minecraft:beacon -1 {Levels:1}
/scoreboard players add @p[-49,76,-1] killCount 5
basically just checking that the player activated a beacon and the points go up. Anyone see a reason this isn't working?
I've set the block and the one before to almost every combination of conditional/unconditional. impulse/chain/repeat, active/redstone and still no results.
I have five in the chain
1. Testforblock - repeat unconditional always active
2. Setblock - chain conditional always active
3. Setblock - chain conditional always active
4. Testforblock - chain conditional always active
5. Scoreboard - chain conditional always active
The first four run fine but the last one never runs and I'm starting to think this is because it affects the scoreboard but I'm pretty certain you can change the scoreboard from a command block (as I have done this with placing a button that block and setting it to impulse). The command itself runs fine when I type it in or run the block on a button but when it's in the chain it doesn't work.
The block before I know is running fine as it tells me that and its basically doing a similar thing as the first one is doing.
The command for the last two blocks are
/testforblock -49 74 -1 minecraft:beacon -1 {Levels:1}
/scoreboard players add @p[-49,76,-1] killCount 5
basically just checking that the player activated a beacon and the points go up. Anyone see a reason this isn't working?
I've set the block and the one before to almost every combination of conditional/unconditional. impulse/chain/repeat, active/redstone and still no results.
Create an account or sign in to comment.
14
1
I believe comparators will read any type of command block, including chains. Alternatively, if you'd like to keep this all in one tick, you could try using /blockdata to turn the beacon on, since it seems like you're activating it yourself anyways.
1
if I use the comparator will the chain blocks emit a redstone signal and activate it?
1
Ok, I figured a few new things out.
I had the chain of blocks descending downwards and it would work until I got the check for beacon because the beacon check is happening right after an iron block is being placed to activate the beacon. The problem is that the beacon activation has a delay after the iron block is placed so the NBT tag is not updated in time for the check.
So i need to somehow make a delay after block placement before checking for the beacon level. Any suggestions?
I know there isnt a wait command so
Im not sure how to do this now.
I had the chain of blocks descending downwards and it would work until I got the check for beacon because the beacon check is happening right after an iron block is being placed to activate the beacon. The problem is that the beacon activation has a delay after the iron block is placed so the NBT tag is not updated in time for the check.
So i need to somehow make a delay after block placement before checking for the beacon level. Any suggestions?
I know there isnt a wait command so
Im not sure how to do this now.
1
Put a comparator and some repeaters going into an impulse command block.
1
try adding on x=, y=, z=, and r= to your command.
1
now Im not so sure its putting out true. is there a way to test that that would be better than what Im doing now?
1
I would put the /say conditional directly after the testforblock, instead of the scoreboard command. That way you'll only depend on the result of that one. If you give me a minute I can try building it myself and see if I can figure out what's wrong.
EDIT I managed to make it work with this command:
Just a few things to note:
1) If there are too many levels the data will not find the beacon correctly. So if you're searching for 1, but the beacon at those coords has 2 levels, the /testforblock will send back a fail.
2) Make sure your chain is actually pointing into each other, especially if it changes directions. It is possible that your commands are correct, but the command blocks just aren't connected properly.
3) You don't strictly need to add a radius if you don't want, but typically it is a good idea to do so. I'd suggest making it bigger than 1 though.
EDIT I managed to make it work with this command:
testforblock 932 5 60 beacon -1 {Levels:1}
Just a few things to note:
1) If there are too many levels the data will not find the beacon correctly. So if you're searching for 1, but the beacon at those coords has 2 levels, the /testforblock will send back a fail.
2) Make sure your chain is actually pointing into each other, especially if it changes directions. It is possible that your commands are correct, but the command blocks just aren't connected properly.
3) You don't strictly need to add a radius if you don't want, but typically it is a good idea to do so. I'd suggest making it bigger than 1 though.
1
It will give you an error message if it isnt outputting true or will leave it blank.
Put a radius of 1 in your selector for your last cmd block
Put a radius of 1 in your selector for your last cmd block
1
It definitely works like what you have should work. The only thing I can really suggest is to double check your objective types and names, and just make sure you didn't actually cross anything.
Are you sure the /testforblock right before the final scoreboard command is returning true? Don't trust the output bar beneath the command, it sometimes doesn't update if the command fails.
Are you sure the /testforblock right before the final scoreboard command is returning true? Don't trust the output bar beneath the command, it sometimes doesn't update if the command fails.
1
I added another block after the last one to "say" something but it never runs so that means either the 4th block isnt sending to do something down the chain or the 5th block has something that can't be done
1
changed to
/scoreboard players add @p[-49,76,-1,3] killCount 5
still doesnt work. when I type it in as just a command run it it , it works when i am close enough but otherwise gives the "error UUID" error message.
/scoreboard players add @p[-49,76,-1,3] killCount 5
still doesnt work. when I type it in as just a command run it it , it works when i am close enough but otherwise gives the "error UUID" error message.
1
/testforblock ~ ~ ~4 minecraft:iron_block (repeat unconditional always active)
/setblock ~ ~2 ~ iron_block (chain conditional always active)
/setblock ~ ~6 ~ minecraft:air (chain conditional always active)
/testforblock -49 74 -1 minecraft:beacon -1 {Levels:1} (chain conditional always active)
/scoreboard players add @p[-49,76,-1] killCount 5 (chain conditional always active)
yes I set it to execute that way and the block before does output to console and lets me know that it succeeded
/setblock ~ ~2 ~ iron_block (chain conditional always active)
/setblock ~ ~6 ~ minecraft:air (chain conditional always active)
/testforblock -49 74 -1 minecraft:beacon -1 {Levels:1} (chain conditional always active)
/scoreboard players add @p[-49,76,-1] killCount 5 (chain conditional always active)
yes I set it to execute that way and the block before does output to console and lets me know that it succeeded
1
Sorrrryyyy wasn't paying attention. You need a radius in your selector.
1
Please give us all of the commands.
Also, if it is set to conditional, it will require that the chain block before it successfully executes its command.
Not only that but I need to see how your individual objectives are set up. If it is the wrong type of objective, it could be an issue.
Also, if it is set to conditional, it will require that the chain block before it successfully executes its command.
Not only that but I need to see how your individual objectives are set up. If it is the wrong type of objective, it could be an issue.