Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Block position help!

Comments in 'Plugin Development' started by Muqsit, Apr 9, 2016.

  1. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    How do I get the block that's touching STILL_WATER block?
    For instances, I wanna work on sugarcane generation, how do I get the block that's touching 'STILL_WATER'?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    $isRiverbank false;
    for(
    $side 2$side <= 5$side++){
      if(
    $block->getSide($side)->getId() === Block::STILL_WATER){
        
    $isRiverbank true;
        break;
      }
    }

    if(
    $isRiverbank){
      ...
    }
    Muqsit and Hotshot_9930 like this.

Share This Page

Advertisement