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

Finding closest $block to player..

Comments in 'Plugin Development' started by dxm_hippie, Jun 30, 2015.

  1. dxm_hippie
    Offline

    dxm_hippie Active Member Plugin Developer

    Joined:
    Feb 1, 2015
    Posts:
    413
    Plugins:
    1
    Minecraft User:
    XxDXM_hippiexX
    could anyone tell me how i can find the closest air block to a player? i tried

    PHP:
    $to rand(1,3);
                        
    $block $player->getLevel()->getBlockIdAt$player->$to$player->$to$player->$to);
                        if (
    $block === Item::AIR){
    and got this error
    ClassCastException: "Object of class pocketmine\level\Location could not be converted to int
    any help?

Share This Page

Advertisement