Players in creative cannot die from non-magic (plugin/console) causes.
This commit is contained in:
williamtdr 2014-07-11 09:07:24 -05:00
parent 167ee97569
commit a8359f29a8

View File

@ -59,6 +59,9 @@ abstract class Living extends Entity implements Damageable{
public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){
//TODO: attack tick limit
if($this instanceof Player && $this->getGamemode() === 1 && $source != EntityDamageEvent::CAUSE_MAGIC) {
return;
}
$pk = new EntityEventPacket();
$pk->eid = $this->getID();
$pk->event = 2; //Ouch!