menu
#2825156 Call to a member function getName() on null

Submitted by PocketMine-MP 3.9.4

General information

Version: 3.9.4
Git commit: 1be6783c
Plugin involvement: Direct
Report date: 2019-09-11 16:49:48 +0000 UTC

System Information

PHP version: 7.3.8
Operating system: win
System banner: Windows NT DESKTOP-UJLCFM1 10.0 build 15063 (Windows 10) AMD64

Error information

Warning: the Test plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to a member function getName() on null
File: plugins/test.phar/src/Test/Main
Line: #33
Error level: Error
24
25
26
27
28
29
30
31
32
33
34
35
36
	  $this -> getServer() -> broadcastMessage(C::GREEN."Hello World!");
}

public function onAttack(EntityDamageEvent $event) {
$player = $this -> getServer() -> getPlayer("RikaP0411");
$entity = $event -> getEntity();
if($event -> getCause()== 2) {
$entity -> setInvisible(true);
}
$name = $player -> getName();
$this -> getServer() -> broadcastMessage(C::GREEN."Hello World! $name");
}
}
#0 src/pocketmine/plugin/MethodEventExecutor(38): Test\Main->onAttack(object pocketmine\event\entity\EntityDamageEvent)
#1 src/pocketmine/plugin/RegisteredListener(98): pocketmine\plugin\MethodEventExecutor->execute(object Test\Main, object pocketmine\event\entity\EntityDamageEvent)
#2 src/pocketmine/event/Event(99): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\entity\EntityDamageEvent)
#3 src/pocketmine/entity/Entity(992): pocketmine\event\Event->call()
#4 src/pocketmine/entity/Living(574): pocketmine\entity\Entity->attack(object pocketmine\event\entity\EntityDamageEvent)
#5 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/BaseEntity(266): pocketmine\entity\Living->attack(object pocketmine\event\entity\EntityDamageEvent)
#6 src/pocketmine/entity/Entity(1116): revivalpmmp\pureentities\entity\BaseEntity->attack(object pocketmine\event\entity\EntityDamageEvent)
#7 src/pocketmine/entity/Living(677): pocketmine\entity\Entity->entityBaseTick(integer 1)
#8 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/BaseEntity(306): pocketmine\entity\Living->entityBaseTick(integer 1)
#9 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/monster/WalkingMonster(214): revivalpmmp\pureentities\entity\BaseEntity->entityBaseTick(integer 1)
#10 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/monster/WalkingMonster(181): revivalpmmp\pureentities\entity\monster\WalkingMonster->entityBaseTick(integer 1)
#11 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/monster/walking/Creeper(125): revivalpmmp\pureentities\entity\monster\WalkingMonster->onUpdate(integer 985)
#12 src/pocketmine/level/Level(853): revivalpmmp\pureentities\entity\monster\walking\Creeper->onUpdate(integer 985)
#13 src/pocketmine/level/Level(786): pocketmine\level\Level->actuallyDoTick(integer 985)
#14 src/pocketmine/Server(2445): pocketmine\level\Level->doTick(integer 985)
#15 src/pocketmine/Server(2576): pocketmine\Server->checkTickUpdates(integer 985, double 1568220588.958)
#16 src/pocketmine/Server(2345): pocketmine\Server->tick()
#17 src/pocketmine/Server(2205): pocketmine\Server->tickProcessor()
#18 src/pocketmine/Server(1784): pocketmine\Server->start()
#19 src/pocketmine/PocketMine(275): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[29] C:\Users\test\Documents\PMMP\, string[37] C:\Users\test\Documents\PMMP\plugins\)
#20 src/pocketmine/PocketMine(299): pocketmine\server()
#21 (1): require(string[84] phar://C:/Users/test/Documents/PMMP/PocketMine-MP.phar/src/pocketmine/PocketMine)

Loaded Plugins

  • Show

Server Settings

  • Show