My Code: PHP: public function computer($player){ $cfg = $this->getConfig(); $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); if($api === null || $api->isDisabled()){ return; } $form = $api->createSimpleForm(function (Player $player, array $data){ $result = $data[0]; if($result === null){ return; } switch($data){ case 0: $player->sendMessage($this->getConfig()->get("computer-verlassen-msg")); return; case 1: $this->quests($player); return; } }); $form->setTitle($cfg->get("computer-title")); $form->setContent($cfg->get("computer-content")); $form->addButton($cfg->get("computer-verlassen")); $form->addButton($cfg->get("computer-quests")); $form->sendToPlayer($player); } The Error: Code: [13:16:18] [Server thread/CRITICAL]: TypeError: "Argument 2 passed to derc\qcp\main::derc\qcp\{closure}() must be of the type array, int given, called in phar:///home/minecraft/plugins/FormAPI.phar/src/jojoe77777/FormAPI/Form.php on line 46" (EXCEPTION) in "plugins/QCP (3).phar/src/derc/qcp/main" at line 104 What i should do?
PHP: $form = $api->createSimpleForm(function (Player $player, array $data){ to PHP: $form = $api->createSimpleForm(function (Player $player, int $data){
Code: [16:23:45] [Server thread/CRITICAL]: TypeError: "Argument 2 passed to derc\qcp\main::derc\qcp\{closure}() must be of the type array, int given, called in phar:///home/minecraft/plugins/FormAPI.phar/src/jojoe77777/FormAPI/Form.php on line 46" (EXCEPTION) in "plugins/QCP (9).phar/src/derc/qcp/main" at line 93 [16:23:45] [Server thread/CRITICAL]: #0 plugins/FormAPI.phar/src/jojoe77777/FormAPI/Form(46): derc\qcp\main->derc\qcp\{closure}(object pocketmine\Player, integer 1)
You have not changed the code like I told you to. The plugin is running from .phar file, so I doubt that you made the changes, compiled and ran the file. Can you tell me how did you edit the code? Make sure it is executing the code you have edited!
PHP: $form = $api->createSimpleForm(function (Player $player, array $data){ to: PHP: $form = $api->createSimpleForm(function (Player $player, int $data){
The error message says that the code that causes the problem is inside a frickin Phar file. Did you edit the .phar file directly? Code: "plugins/QCP (9).phar/src/derc/qcp/main" at line 93
Usually plugins are created as a folder structure and then converted into a ZIP file. Then the ZIP file is converted into a PHAR file. That's why it says .PHAR.
Did you seriously think that every developer when creating plugins, on every single change of the code has to go through all that process? Did you know that you can use plugin DevTools which will load plugins in folder structure. I bet you did, however did you know that you don't have to .zip the file! You can use /makeplugin <pluginName> command which will take folder structured plugin and turn it into .phar file! I'm still baffled. Did you really unphar it, change the code, zip the folder and then phar the archive?
Do you think I'm somehow mentally behind? I know how to make plugins and work on a large server. I'm the error-obscure because I have no idea why my script that hasn't let me in the sting for months suddenly doesn't go anymore I ask for help here and get an answer but if you don't know what error messages look like and that's normal when you upload a PHAR to the server. You can help but if you really have no idea about it then don't confuse me any further Thank you anyway
Of course I can also recycle older plugins but I wanted to educate myself here with you nice people. But I'm sorry if you misunderstand my questions and then think I'm an idiot. I come from Germany and I learned English at school and apparently can't do it enough. In any case, I know how to convert plugins. Otherwise the plugin would not be loaded at all and it would not be able to play any errors at all.
In addition, we have specifications and do not test our plugins locally So that other team members can also look at the process, we upload the plugins step by step to a server as a phar file. I didn't edit anything but programmed everything myself
I maybe have multiple Plorbelms but for now its the error from the top https://www.mediafire.com/file/o16eap5uwmuimek/QCP+(11).phar/file