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

Solved My plugin doesn't load and it don't show any error

Discussion in 'Plugin Help' started by GeistFan, Feb 22, 2021.

  1. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    Please help me, my plugin JoinLeave doesn't load and it don't show any error
    - GeistFan
     

    Attached Files:

  2. timistwild

    timistwild Spider Jockey

    Messages:
    33
    hi! Whats your discord name?
     
  3. Primus

    Primus Zombie Pigman

    Messages:
    749
    Reminding that zip files inside plugins folder will not be loaded. Extracting the plugin as a folder, is a step closer, however that will not load as well, you need DevTools.
     
  4. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    GeistFan#8135
     
  5. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    No i use a Online Compiler to Compile the zip to a phar
     
  6. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    :facepalm: No shoot that it doesn't load.

    Online compilers covert zip files to .phar in a different way that DevTools does.

    1. Get DevTools
    2. Run /makeplugin [plugin name]
    3. Go to plugin_data directory -> DevTools
    4. Find your plugin that was converted into .phar
    5. Download and reupload to plugins directory

    Or,

    Do what @Primus did
     
  7. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
  8. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Just do what's told to do
     
  9. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    But my link is your devtools but online
     
  10. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Is it official? no it is not
     
  11. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    Yes, but I always use it and it always works best
     
  12. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Then how come it's not working this time?

    Just try other ways. Jesus

    No one will help you unless you try the ways that others provide. If you would like to stick with your solution, go ahead. I won't stop you.
     
  13. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    How do the files get into the .phar?
     
  14. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    I literally told you the ways. Could you read and reply?
     
  15. mmm545

    mmm545 Baby Zombie

    Messages:
    152
    GitHub:
    mmm545
    Just fyi, it's not compiling, it just takes all the files and compresses them into one file, similar to a zip file
     
    minijaham and Primus like this.
  16. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    No i used DevTools and have the Plugin folder in the plugins folder. Now ist loads but with this crashdump:
    PocketMine-MP Crash Dump Fri Mar 19 22:04:09 GMT 2021

    Error: Declaration of JoinLeave\Main::eek:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $cmd, string $label, array $args, pocketmine\Player $player): bool must be compatible with pocketmine\plugin\PluginBase::eek:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, string $label, array $args): bool
    File: plugins/JoinLeave-1.1.0/src/JoinLeave/Main
    Line: 33
    Type: E_COMPILE_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN

    Code:
    [24] $event->setJoinMessage("");
    [25] }
    [26]
    [27] public function onPlayerQuit(PlayerQuitEvent $event)
    [28] {
    [29] $player = $event->getPlayer();
    [30] $event->setQuitMessage("");
    [31] }
    [32]
    [33] public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args, Player $player):bool
    [34] {
    [35] if($cmd->getName() === "tjl")
    [36] {
    [37] if($sender->hasPermission("JoinLeaveTest.cmd"))
    [38] {
    [39] $sender->sendMessage("JoinLeave ist Aktiv!");
    [40] }
    [41] }
    [42] }
    [43]

    Backtrace:

    PocketMine-MP version: 3.18.0 [Protocol 428]
    Git commit: 3f6490626319152dca07a5c61a1e94f8d5793d56
    uname -a: Windows NT LAPTOP-ASN2539Q 10.0 build 18363 (Windows 10) AMD64
    PHP Version: 7.4.15
    Zend version: 3.4.0
    OS : WINNT, win
    Composer libraries:
    - adhocore/json-comment 0.1.0@8448076039389f558f39ad0553aab87db3f81614
    - daverandom/callback-validator unknown@unknown
    - pocketmine/binaryutils 0.1.13@0abee38d4e2861621f262c79a2a3d699d8a697f4
    - pocketmine/callback-validator 1.0.3@64787469766bcaa7e5885242e85c23c25e8c55a2
    - pocketmine/classloader 0.1.2@9757928424652393b178a3760073113aa7c9911b
    - pocketmine/log 0.2.1@830b44a2cf96ef703c550abe64302f230231ca49
    - pocketmine/log-pthreads 0.1.3@e477ecf6ec214fdd4415ea1da3fdd9d73bf699ea
    - pocketmine/math 0.2.6@43057cb8c179a9859677b496a788db922fd5cfc3
    - pocketmine/nbt 0.2.18@9f82ca4d7f97fcd9a566e44b63c4f18a7657ae82
    - pocketmine/pocketmine-mp 3.18.0@3f6490626319152dca07a5c61a1e94f8d5793d56
    - pocketmine/raklib 0.12.11@9cce458b8bfde3e4dfdbf70c659fc7b7fe26b5c4
    - pocketmine/snooze 0.1.5@70b5e7937a06878dd321a3182ceb76d56298f2cd
    - pocketmine/spl 0.4.2@6b08b7cf8c4afa17139c9a1b3bf1b408531de161

    Loaded plugins:
    DevTools 1.13.0 by PocketMine Team for API(s) 3.0.0
    Please help me?
    -GeistFan
     
  17. Primus

    Primus Zombie Pigman

    Messages:
    749
    Is this your plugin, or you hired awful dev?

    Anyways, the code you provided has incorrect declaration of onCommand method. I'm at this point just reciting the error message, but in my defence it's self-explanatory message. If you take a look at your method and the one you're overriding, you'll see a big mismatch in parameter types.
     
    minijaham likes this.
  18. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Spot the difference game
     
    Primus likes this.
  19. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    How do you mean?
     
  20. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    What's the difference between

    onCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $cmd, string $label, array $args, pocketmine\Player $player): bool

    and

    onCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, string $label, array $args): bool
     
  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.