Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Call to PiggyLightning::hasEffect() in EventListener when lighting deals damage to a player. #180

95CivicSi opened this Issue Aug 11, 2018 · 1 comment


None yet
2 participants
Copy link

95CivicSi commented Aug 11, 2018

Please make sure your issue complies with these guidelines:

    • Server Software must be the official PMMP w/o vanilla patching plugins (i.e. TeaSpoon)
    • Issue must have not been reported previously
    • Make sure you are on the latest version of PMMP & PiggyCustomEnchants
    • Have a detailed title, like "CustomEnchants::getName() must be..."
    • If possible, provide crashdumps/errors related to the issue.


When using an weapon enchanted with lightning and lightning hits a player, EventListener attempts to call hasEffect() on PiggyLightning.


  • PiggyCustomEnchants: 1.2.0 from Poggit
  • PMMP: 3.1.2

Steps to Reproduce the Issue

  1. Enchant a weapon with Lightning
  2. Use the enchanted weapon to hit other players.
  3. Check console or log after lightning strike player.

Extra Information

2018-08-11 [11:53:05] [Server thread/CRITICAL]: Could not pass event 'pocketmine\event\entity\EntityDamageByEntityEvent' to 'PiggyCustomEnchants v1.2.0': Call to undefined method PiggyCustomEnchants\Entities\PiggyLightning::hasEffect() on PiggyCustomEnchants\EventListener
2018-08-11 [11:53:05] [Server thread/CRITICAL]: Error: "Call to undefined method PiggyCustomEnchants\Entities\PiggyLightning::hasEffect()" (EXCEPTION) in "PiggyCustomEnchants.phar/src/PiggyCustomEnchants/EventListener" at line 1123
2018-08-11 [11:53:05] [Server thread/DEBUG]: #0 PiggyCustomEnchants.phar/src/PiggyCustomEnchants/EventListener(155): PiggyCustomEnchants\EventListener->checkArmorEnchants(pocketmine\Player object, pocketmine\event\entity\EntityDamageByEntityEvent object)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #1 src/pocketmine/plugin/MethodEventExecutor(38): PiggyCustomEnchants\EventListener->onDamage(pocketmine\event\entity\EntityDamageByEntityEvent object)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #2 src/pocketmine/plugin/RegisteredListener(98): pocketmine\plugin\MethodEventExecutor->execute(PiggyCustomEnchants\EventListener object, pocketmine\event\entity\EntityDamageByEntityEvent object)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginManager(752): pocketmine\plugin\RegisteredListener->callEvent(pocketmine\event\entity\EntityDamageByEntityEvent object)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #4 PiggyCustomEnchants.phar/src/PiggyCustomEnchants/Entities/PiggyLightning(52): pocketmine\plugin\PluginManager->callEvent(pocketmine\event\entity\EntityDamageByEntityEvent object)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #5 src/pocketmine/entity/Entity(1378): PiggyCustomEnchants\Entities\PiggyLightning->entityBaseTick(integer 1)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #6 src/pocketmine/level/Level(744): pocketmine\entity\Entity->onUpdate(integer 2076)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #7 src/pocketmine/Server(2359): pocketmine\level\Level->doTick(integer 2076)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #8 src/pocketmine/Server(2516): pocketmine\Server->checkTickUpdates(integer 2076, double 1533981185.4345)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #9 src/pocketmine/Server(2258): pocketmine\Server->tick()
2018-08-11 [11:53:05] [Server thread/DEBUG]: #10 src/pocketmine/Server(2132): pocketmine\Server->tickProcessor()
2018-08-11 [11:53:05] [Server thread/DEBUG]: #11 src/pocketmine/Server(1713): pocketmine\Server->start()
2018-08-11 [11:53:05] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(237): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/primegames/survival/, string /home/primegames/survival/plugins/)
2018-08-11 [11:53:05] [Server thread/DEBUG]: #13 /home/primegames/survival/PocketMine-MP.phar(1): require(string phar:///home/primegames/survival/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

This comment has been minimized.

Copy link
Contributor Author

95CivicSi commented Aug 11, 2018

Fastest way to fix this would be to add the following to PiggyLightning.

public function hasEffect(int $effectId) : bool{
    return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.