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

addParticle() - Class Not Found - Task

Discussion in 'Facepalm' started by Poke, Jul 29, 2017.

  1. Poke

    Poke Shog Chips

    Messages:
    0
    Hello, I shall want to add particle on Keep2 but my task does not want to run.

    keepgame.php
    PHP:
    public function onEnable() {
        
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        
        
    $task = new keepgametask($this);
        
    $this->getServer()->getScheduler()->scheduleRepeatingTask($task1);
        
        
        }
    keepgametask.php
    PHP:
    public function onRun($tick) {
                    
    $this->plugin $this->getOwner();
    $keepmap $this->plugin->getServer()->getLevelByName("Keep2");



    $keepmap->addParticle(new FlameParticle(new Vector3(25033243)));  // It's the line 35
                    
                
    }
    Error
    I does not understand this error because I used the class " pocketmine\level\particle" in both files.
    Sorry for my English, I'm French.
     
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    You have forget to use pocketmine\level\particle\FlameParticle, so plugin is trying to find that file in namespace of keepgamestask.php
     
  3. Poke

    Poke Shog Chips

    Messages:
    0
    Thank you for your help @Kyd !
    Everything works now !

    [​IMG]
     
  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.