1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

pmmp error (I have this error on the console)

Discussion in 'Development' started by Brian Medina, Apr 11, 2017.

  1. Brian Medina

    Brian Medina Spider Jockey

    Messages:
    27
    GitHub:
    NintendoCore16
    error:::[Server thread/CRITICAL]: pocketmine\plugin\PluginException: "pocketmine\event\entity\EntityDamageByEntityEvent does not have a handler list" (EXCEPTION) in "/src/pocketmine/plugin/PluginManager" at line 790

    my code:::
    PHP:
        public function pvpNintendoElDevPro(EntityDamageByEntityEvent $event){
            
    $killer $event->getDamager();
            
    $world $killer->getLevel()->getName();
            
    $mundos $this->getConfig()->get("mundos");
            if(
    in_array($world$mundos)) {
                if (
    $killer instanceof Player) {
                    if(
    $killer->getItemInHand()->getId() === 276){
                        
    $event->setCancelled(false);
                    }else{
                        
    $event->setCancelled(true);
                    }
                }
            }
        }
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    I believe you need to use EntityDamageEvent, then check if it is an instanceof EntityDamageByEntityEvent.
     
  3. Brian Medina

    Brian Medina Spider Jockey

    Messages:
    27
    GitHub:
    NintendoCore16
    Thank you very much, I function
    I use a translator :b bad translator xd
     
    corytortoise likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.