indicate all one type of block

Discussion in 'Plugin Development' started by jomancool54, Sep 30, 2014.

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

    jomancool54

    Is there a way to indicate all one type of block? like all grass blocks or all torches and get all their locations? (within a range of course)
     
  2. Offline

    OracleTarget

    jomancool54
    Loops through the block you want and check if they are from a certain material and if thats true, store it's location somewhere.
     
  3. 1. get the middle of the square you wanna loop through\\
    2. get your startposition: startX = middle.getX()-radius. startZ=..., startY=...\\
    3. loop through all blocks between startposition and the position made of middle.getX()+radius, middle.getY()+radius, middle.getZ()+radius\\
    4. while looping check every single blocks material for the material you want. store their locations into a hashset\\
    5. do whatever you want with those blocks
     
Thread Status:
Not open for further replies.

Share This Page