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

get blocks around player

Comments in 'Plugin Development' started by Artide, Oct 29, 2015.

  1. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    This method doesn't work. I am testing to get the block near the player.
    PHP:
    public function onPlayerMove(PlayerMoveEvent $e){
            
    $p $e->getPlayer();
            foreach(
    $p->getBlocksAround() as $b){
                if(
    $b->getId() === 2){
                    
    $p->sendMessage("TRUE");
                }
            }
        }
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    use var_dump() function to debug your code.

Share This Page

Advertisement