1

Command Block Chain and Scoreboard

missingUser02834's Avatar missingUser028345/5/16 3:53 pm
5/6/2016 3:36 pm
Jmal116's Avatar Jmal116
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.
Posted by missingUser02834's Avatar
missingUser02834
Level 4 : Apprentice Explorer
2

Create an account or sign in to comment.

14

1
05/06/2016 3:36 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
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
05/06/2016 11:44 am
Level 4 : Apprentice Explorer
missingUser02834
missingUser02834's Avatar
if I use the comparator will the chain blocks emit a redstone signal and activate it?
1
05/06/2016 9:24 am
Level 4 : Apprentice Explorer
missingUser02834
missingUser02834's Avatar
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.
1
05/06/2016 9:29 am
Level 53 : Grandmaster Lego Builder
CGBrothers
CGBrothers's Avatar
Put a comparator and some repeaters going into an impulse command block.
1
05/05/2016 5:21 pm
Level 55 : Grandmaster Dragon
Skitto493
Skitto493's Avatar
try adding on x=, y=, z=, and r= to your command.
1
05/05/2016 4:50 pm
Level 4 : Apprentice Explorer
missingUser02834
missingUser02834's Avatar
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
05/05/2016 5:25 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
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: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
05/05/2016 5:03 pm
Level 53 : Grandmaster Lego Builder
CGBrothers
CGBrothers's Avatar
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
1
05/05/2016 4:36 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
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.
1
05/05/2016 4:29 pm
Level 4 : Apprentice Explorer
missingUser02834
missingUser02834's Avatar
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
05/05/2016 4:26 pm
Level 4 : Apprentice Explorer
missingUser02834
missingUser02834's Avatar
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.
1
05/05/2016 4:13 pm
Level 4 : Apprentice Explorer
missingUser02834
missingUser02834's Avatar
/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
1
05/05/2016 4:19 pm
Level 53 : Grandmaster Lego Builder
CGBrothers
CGBrothers's Avatar
Sorrrryyyy wasn't paying attention. You need a radius in your selector.
1
05/05/2016 4:06 pm
Level 53 : Grandmaster Lego Builder
CGBrothers
CGBrothers's Avatar
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.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome