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

Is it possible to get the player's level where he try to break or place a block?

Comments in 'Plugin Development' started by Dzida94, Dec 7, 2013.

  1. Dzida94
    Offline

    Dzida94 New Member

    Joined:
    Dec 3, 2013
    Posts:
    4
    Minecraft User:
    Dzida94
    I use this.
    $this->api->addHandler("player.block.touch", array($this, "eventHandler"));

    I tried to find a example in other plugins but a found nothing.
    Thx for help :)
  2. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    $data['player']->level;
    or
    $data['target']->level;
  3. Dzida94
    Offline

    Dzida94 New Member

    Joined:
    Dec 3, 2013
    Posts:
    4
    Minecraft User:
    Dzida94
    Thanks for fast answer. but when i try use it I have errors.

    Code:
    [ERROR] A level 4096 error happened: "Object of class Level could not be converted to string" in "C:\Users\User\Desktop\pocket\PocketMine-MP\src\API\PluginAPI.php(87) : eval()'d code" at line 70
    
    Last edited: Dec 7, 2013

Share This Page

Advertisement