menu
#4656621 Call to undefined method pocketmine\entity\object\PrimedTNT::getInventory()

Submitted by PocketMine-MP 3.16.0

General information

Version: 3.16.0
Git commit: d2f68836
Plugin involvement: Direct
Report date: 2020-11-21 18:25:06 +0000 UTC

System Information

PHP version: 7.3.23
Operating system: linux
System banner: Linux 4a90c0af-6fc3-476f-9dae-c7a33bc4948e 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64

Error information

Warning: the BaguetteMagique plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to undefined method pocketmine\entity\object\PrimedTNT::getInventory()
File: plugins/BaguetteMagique.phar/src/Bourdon/BaguetteMagique/Main
Line: #42
Error level: Error
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
        if (!isset($minute)) $minute = 0;
if (!isset($second)) $second = 0;

return ["h" => $hour, "m" => $minute, "s" => $second];
}

public function onDamage(EntityDamageByEntityEvent $event) {
$victime = $event->getEntity();
$damager = $event->getDamager();
$item = $damager->getInventory()->getItemInHand();

if ($item->getId(262) && $item->getDamage(43)) {
if (isset($this->cooldown[$damager->getName()]) && $this->cooldown[$damager->getName()] > time()) {
$temps = $this->calculTime($this->cooldown[$damager->getName()] - time());
$damager->sendPopup("§cLa baguette magique est en cooldown de §c" . $temps["s"] . " §csecondes");
$event->setCancelled();
return false;
}
$this->cooldown[$damager->getName()] = time() +60;
$event->setKnockBack(1);
#0 src/pocketmine/plugin/MethodEventExecutor(42): Bourdon\BaguetteMagique\Main->onDamage(object pocketmine\event\entity\EntityDamageByEntityEvent)
#1 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object Bourdon\BaguetteMagique\Main, object pocketmine\event\entity\EntityDamageByEntityEvent)
#2 src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\entity\EntityDamageByEntityEvent)
#3 src/pocketmine/entity/Entity(932): pocketmine\event\Event->call()
#4 src/pocketmine/entity/Living(545): pocketmine\entity\Entity->attack(object pocketmine\event\entity\EntityDamageByEntityEvent)
#5 src/pocketmine/Player(3891): pocketmine\entity\Living->attack(object pocketmine\event\entity\EntityDamageByEntityEvent)
#6 plugins/PvPCore_v2.0.2 (2).phar/src/jkorn/pvpcore/player/PvPCPlayer(137): pocketmine\Player->attack(object pocketmine\event\entity\EntityDamageByEntityEvent)
#7 src/pocketmine/level/Explosion(202): jkorn\pvpcore\player\PvPCPlayer->attack(object pocketmine\event\entity\EntityDamageByEntityEvent)
#8 src/pocketmine/entity/object/PrimedTNT(112): pocketmine\level\Explosion->explodeB()
#9 src/pocketmine/entity/object/PrimedTNT(97): pocketmine\entity\object\PrimedTNT->explode()
#10 src/pocketmine/entity/Entity(1393): pocketmine\entity\object\PrimedTNT->entityBaseTick(integer 1)
#11 src/pocketmine/level/Level(854): pocketmine\entity\Entity->onUpdate(integer 11028)
#12 src/pocketmine/level/Level(787): pocketmine\level\Level->actuallyDoTick(integer 11028)
#13 src/pocketmine/Server(2267): pocketmine\level\Level->doTick(integer 11028)
#14 src/pocketmine/Server(2398): pocketmine\Server->checkTickUpdates(integer 11028, double 1605983106.348)
#15 src/pocketmine/Server(2154): pocketmine\Server->tick()
#16 src/pocketmine/Server(1994): pocketmine\Server->tickProcessor()
#17 src/pocketmine/Server(1588): pocketmine\Server->start()
#18 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/)
#19 src/pocketmine/PocketMine(304): pocketmine\server()
#20 (11): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show