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

Best way to make a cube? - AREA

Comments in 'Plugin Development' started by PaulchenHD, Oct 16, 2016.

  1. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    I like to know the best way to make a cube (area) and if player is outside the cube/area ? ;)
  2. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    PHP:
    public function isOutSideOf(Vector3$pos,Vector3$vecLow,Vector3$vecHigh)
        {
            return
                
    $pos->$vecLow->OR
                
    $pos->$vecLow->OR
                
    $pos->$vecLow->OR
                
    $pos->$vecHigh->OR
                
    $pos->$vecHigh->OR
                
    $pos->$vecHigh->z;
        }
    Hopefully this should do the trick but other may have better ways to check for that one
    archie426 and PaulchenHD like this.
  3. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    I test it tomorrow thank you very much ;)
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV

Share This Page

Advertisement