Well... This should now work...

This commit is contained in:
Adsooi 2017-04-05 10:59:42 +02:00
parent ffe5ff3acb
commit 51a14b7d3b

View file

@ -54,7 +54,7 @@ class Main extends PluginBase implements \pocketmine\event\Listener {
if($event instanceof \pocketmine\event\entity\EntityDamageByEntityEvent) { if($event instanceof \pocketmine\event\entity\EntityDamageByEntityEvent) {
if($event->getDamager() instanceof Player && if($event->getDamager() instanceof Player &&
isset($this->sessions[$event->getDamager()->getName()])) { isset($this->sessions[$event->getDamager()->getName()])) {
$event->getEntity()->addEffect(\pocketmine\entity\Effect::getEffectByName("invisibility")->setAmbiant(true)->setVisible(false)); $event->getEntity()->addEffect(\pocketmine\entity\Effect::getEffectByName("invisibility")->setAmbient(true)->setVisible(false));
$event->getEntity()->setNameTag($this->sessions[$event->getDamager()->getName()]); $event->getEntity()->setNameTag($this->sessions[$event->getDamager()->getName()]);
$event->getEntity()->setNameTagAlwaysVisible(true); $event->getEntity()->setNameTagAlwaysVisible(true);
$event->getEntity()->setNameTagVisible(true); $event->getEntity()->setNameTagVisible(true);