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

bug in myplugin

Comments in 'Plugin Development' started by Seetch, Dec 20, 2015.

  1. Seetch
    Offline

    Seetch New Member

    Joined:
    Feb 5, 2015
    Posts:
    22
    Minecraft User:
    Seetch
    What is error, please tell me... :confused:

    Code:
    Error: Call to undefined method pocketmine\entity\PrimedTNT::getPlayer()
    File: /s_api/src/seetch/sapi
    Line: 180
    Type: E_ERROR
    
    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN: sapi v0.1 beta by seetch_
    
    Code:
    [171]         }
    [172]     }*/
    [173]   
    [174]     public function WhoDamager(EntityDamageEvent $e) {
    [175]         $entity = $e->getEntity();
    [176]         $entity = $e->getEntity();
    [177]         $level = $this->getServer()->getDefaultLevel();
    [178]         if ($entity instanceof Player) {
    [179]             if ($e instanceof EntityDamageByEntityEvent) {
    [180]                 $damager = $e->getDamager()->getPlayer();
    [181]                 $cause = $e->getEntity()->getPlayer()->getName();
    [182]                 if ($e->getDamager() instanceof Player) {
    [183]                     if($level->getTime() < 16500) {
    [184]                         if(!($damager->isOp())) {
    [185]                             $e->setCancelled();
    [186]                             $damager->sendTip(F::RED. "pvp prohibited!");
    [187]                         }
    [188]                     }
    [189]                     $v = new Vector3($entity->getLevel()->getSpawnLocation()->getX(),$entity->getPosition()->getY(),$entity->getLevel()->getSpawnLocation()->getZ());
    [190]                     $r = $this->getServer()->getSpawnRadius();
  2. Intyre
    Offline

    Intyre Staff Member PocketMine Team

    Joined:
    Aug 24, 2013
    Posts:
    118
    Minecraft User:
    Intyre
    Did I win?
  3. Seetch
    Offline

    Seetch New Member

    Joined:
    Feb 5, 2015
    Posts:
    22
    Minecraft User:
    Seetch
    What? Win?
  4. Seetch
    Offline

    Seetch New Member

    Joined:
    Feb 5, 2015
    Posts:
    22
    Minecraft User:
    Seetch
    i'm used custom core - imagicalmine.
  5. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    Isnt this the error...
    Just remove "->getPlayer()" after "$e->getDamager()" on line 180 and "->getPlayer()" after
    $cause = $e->getEntity() on line 181
    AndrewBit and Vaivez66 like this.
  6. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    PHP:
    $damager $e->getDamager();//FIX
  7. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    What is error? It means the state or condition of being wrong in conduct or judgment. :p
    AndrewBit likes this.
  8. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    @wolfdale say it first...
    Are you trying to increase your post count?
  9. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    i have lagg in my lab :<
    iDirtPlayzMC likes this.

Share This Page

Advertisement