Solved Beacon Block count

Discussion in 'Plugin Development' started by Niv-Mizzet, Sep 29, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    Niv-Mizzet

    Hi!
    I am a noob at plugin development, so this may be a noob question.
    How would I count the amount of beam blocks of a certain color (The beam shooting out from the beacon) from the beacon to the build height(Y 256), including the glass blocks that change the color placed on top of the beacon. I would also like to make sure that a special glass is the only block that can be placed on top of the beacon.
    Thanks in advance!
     
  2. To count the blocks I would loop over every block at the x and y coordinate of the beacon up to y = 256 and check for the blocks. To check if the placed block is the "special" one listen for the PlaceBlockEvent and check if the block below the placed block is a beacon
     
  3. Offline

    Niv-Mizzet

    Thanks so much!
     
Thread Status:
Not open for further replies.

Share This Page