Update Main.php

This commit is contained in:
djdisodo 2018-06-10 18:04:09 +09:00 committed by GitHub
parent 035c2e332f
commit 45ea002c6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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