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

particle problem, crash...

Comments in 'Plugin Development' started by TheMaks, Sep 19, 2015.

  1. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    Why crash?!?!?

    Error: Call to undefined method pocketmine\event\player\PlayerInteractEvent::getLevel()
    File: /tuchparticle.phar/src/TheMaks/Main
    Line: 21
    Type: E_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN: ToPa v1

    Code:
    [12] $this->getLogger()->info("on...");
    [13] $this->getServer()->getPluginManager()->registerEvents($this,$this);
    [14] }
    [15] public function onInteract(PlayerInteractEvent $event){
    [16] $p = $event->getPlayer();
    [17] if($p->getInventory()->getItemInHand()->getId() == 280){
    [18] $scale =1;
    [19] $pos = new Vector3($p->getX()+1,$p->getY()+1,$p->getZ());
    [20] $particle = new HeartParticle($pos, $scale);
    [21] $event->getLevel()->addParticle($particle);
    [22] }
    [23] }
    [24] }
    Last edited by a moderator: Sep 19, 2015
  2. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    Maybe you're missing getPlayer... I don't know, just try if it's work :)
    PHP:
    $event->getPlayer()->getLevel()->addParticle($particle);
    Creeperface and Legoboy0215 like this.
  3. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    Very big thanks :3

Share This Page

Advertisement