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

Need Help with Task

Discussion in 'Facepalm' started by StuckDexter, Mar 12, 2017.

  1. StuckDexter

    StuckDexter Silverfish

    Messages:
    24
    I have a plugin with a Task but I wont work I dont know why?
    Code:
    [00:22:01] [Server thread/CRITICAL]: Error: "Cannot call constructor" (EXCEPTION) in "/phar_Core_wVkNyrAXoG6Sn2K.phar/src/StuckDexter/Core" at line 2988
    [00:22:01] [Server thread/INFO]: Disabling Core v2
    [00:22:01] [Server thread/INFO]: [Core] Config saved
    
    Thats the code
    PHP:
    class Chest extends PluginBase{

        public function 
    __construct(Core $plugin) {
            
    parent::__construct($plugin);
            
    $this->plugin $plugin;
        }
      
    public function 
    onRun($tick){
                
    $chests = new Config($this->plugin->getDataFolder() . "chests.yml"Config::YAML);
                    
    $level->addParticle(new FloatingTextParticle(new Vector3($chests->get("XChest1"), $chests->get("YChest1"),$chests->get("ZChest1")),"",  "§l§6<==CHEST==>
                    §a-->>>OPEN<<<--"
    ));
    }
    }
     
    Last edited by a moderator: Mar 12, 2017
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    A task is supposed to extend PluginTask, not PluginBase.
     
  3. StuckDexter

    StuckDexter Silverfish

    Messages:
    24
    Oh Im so stupid
     
  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.