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

Solved Strange error

Comments in 'Plugin Development' started by ImagicalGamer, Apr 12, 2016.

  1. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    I'm getting this error:
    Code:
    ClassNotFoundException: "Class pocketmine\Entity not found" (EXCEPTION) in "/src/spl/BaseClassLoader" at line 144
    
    This is the code:
    PHP:
      public function onDrop(PlayerDropItemEvent $e){
            
    $item $e->getItem();
            if(
    $item->getId() === Item::EGG){
             
    $p $e->getPlayer();
                     
    $light = new AddEntityPacket();
         
    $light->type 93;
         
    $light->eid Entity::$entityCount++;
         
    $light->metadata = array();
         
    $light->speedX 0;
         
    $light->speedY 0;
         
    $light->speedZ 0;
         
    $light->$p->x;
         
    $light->$p->y;
         
    $light->$p->z;
         
    $p->dataPacket($light);
            }
        }
    These are the classes:
    Code:
    use pocketmine\event\Listener;
    use pocketmine\plugin\PluginBase;
    use pocketmine\utils\TextFormat;
    use pocketmine\math\Vector3;
    use pocketmine\network\protocol\AddEntityPacket;
    use pocketmine\Entity;
    use pocketmine\Player;
    use pocketmine\Server;
    use pocketmine\item\Item;
    //use pocketmine\event\player\PlayerItemHeldEvent;
    use pocketmine\event\player\PlayerDropItemEvent;
    I'm using pocketmine\Entity but it's saying it's not found.
  2. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    Nvm xD it's pocketmine/entity/Entity my mistake :p
    Legoboy0215 likes this.

Share This Page

Advertisement