1

Can you use the testforblock command on a beacon's beam? enter image description here

So, if there is a beam above the beacon, the testforblock command will turn on, for it found a beacon's beam. Can this work?

3

No, the beam is neither a block nor entity to detect.

You can check whether or not the beacon tile entity has a Levels integer tag of a certain value, which indicates how many valid layers of the pyramid there are for the beacon. For example, if there was only one level of the pyramid, the Levels value will be 1:

/testforblock X Y Z minecraft:beacon -1 {Levels:1}

Alternatively, you can check for a value of 0 and invert the signal to cover all possible levels.

5
  • I'm making a map where it checks if the light beam can go all the way through the glass with no blocks blocking it successfully. Can this method work? – Akidus Jan 25 '16 at 0:57
  • @Akidus Yes, Levels will be 0 if the beam was blocked. – Skylinerw Jan 25 '16 at 0:59
  • Okay. How would I put this in a command block , if the beam was right next to the command block? Never mind. Got it. – Akidus Jan 25 '16 at 1:00
  • Or, is there a way to do this with specific colors? – Akidus Jan 25 '16 at 1:10
  • @Akidus The only way to detect the color is to manually check for stained glass above the beacon, which could take a lot of work (to the point of probably not being feasible) if allowing them to be placed both at any height and mixing colors. – Skylinerw Jan 25 '16 at 1:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.