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

Solved Using FormAPI in Eventlistener

Discussion in 'Plugin Help' started by max1245, Mar 5, 2021.

  1. max1245

    max1245 Spider

    Messages:
    9
    Hey i want to use the FormAPI in my Eventlistener. How can "import" the Api in the listener?
     
  2. max1245

    max1245 Spider

    Messages:
    9
    I already wrote an Constructor but i have to change it right?
    PHP:
    public function __construct(Main $plugin){
            
    $this->plugin $plugin;
        }
     
  3. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Having other functions in listener files doesn't matter.

    However, you can make the form function a static function and call it directly.
    For example,
    PHP:
    // Main File
    public static function openForm($player) {}

    // EventListener
    Main::openForm($player); // Open form
    Solved?
     
  4. max1245

    max1245 Spider

    Messages:
    9
    Oh yea good idea thank you!
     
  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.