1
Command Block help, please
Hello fellow forum people, I am having some trouble with my command block-ing an I was wondering if any of you could help. Also, I'm in version 1.11.2 to help.
The project I am working on has a system in place in which three plates can be activated in any order, causing three green squares to appear above the main door. My question is, how can I use command blocks to trigger another event by detecting once the squares are in place since they can appear in a random order?
The project I am working on has a system in place in which three plates can be activated in any order, causing three green squares to appear above the main door. My question is, how can I use command blocks to trigger another event by detecting once the squares are in place since they can appear in a random order?
Create an account or sign in to comment.
4
2
use testforblock
testforblock <x> <y> <z> <TileName> [dataValue] [dataTag]
For example:
to test for a stone block at x= 1, y=50, z=10 do this:
testforblock 1 50 10 stone
1. In your case you'd want to set up a scoreboard dummy objective.
2. You'll need a command block with the testforblock that has a conditional chain that adds one to the score and a third command block that deletes the command block before it so that the chain won't infinitely add a point the the score.
3. Repeat step 2 so that there are 3 of them. for each one change the testforblock coords to the position of where you would spawn in the green blocks
4. Have a repeating command block that has this as a condition "score_YOURSCOREBOARD_min=3"
And with that another conditional chain following it with your command you want to trigger.
If you didn't understand this you got lots of googling to do. this is basic command block stuff
EDIT:
I just thought of an easier way. If you are using one command block to summon in the green squares for each of the three squares this will work.
1. Set up a dummy scoreboard objective. Name it whatever you want
2. Have a conditional chain following the command block you've already setup that spawns in the green square.
3. Inside the conditional chain command block add 1 to the dummy scoreboard that you custom named.
4. Have a repeating command block that has this as a condition "score_YOURSCOREBOARD_min=3"
And with that another conditional chain following it with your command you want to trigger.
testforblock <x> <y> <z> <TileName> [dataValue] [dataTag]
For example:
to test for a stone block at x= 1, y=50, z=10 do this:
testforblock 1 50 10 stone
1. In your case you'd want to set up a scoreboard dummy objective.
2. You'll need a command block with the testforblock that has a conditional chain that adds one to the score and a third command block that deletes the command block before it so that the chain won't infinitely add a point the the score.
3. Repeat step 2 so that there are 3 of them. for each one change the testforblock coords to the position of where you would spawn in the green blocks
4. Have a repeating command block that has this as a condition "score_YOURSCOREBOARD_min=3"
And with that another conditional chain following it with your command you want to trigger.
If you didn't understand this you got lots of googling to do. this is basic command block stuff
EDIT:
I just thought of an easier way. If you are using one command block to summon in the green squares for each of the three squares this will work.
1. Set up a dummy scoreboard objective. Name it whatever you want
2. Have a conditional chain following the command block you've already setup that spawns in the green square.
3. Inside the conditional chain command block add 1 to the dummy scoreboard that you custom named.
4. Have a repeating command block that has this as a condition "score_YOURSCOREBOARD_min=3"
And with that another conditional chain following it with your command you want to trigger.
1
Thank you so much, this is a really big help! It worked just like you described. :)
1
Hey, I'd have to see exactly what you are talking about. If you want shoot me a PM.
1
hey is this on a server and i don't really get it can i have some more info?