mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Fix #1615
Players in creative cannot die from non-magic (plugin/console) causes.
This commit is contained in:
parent
167ee97569
commit
a8359f29a8
@ -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!
|
||||
|
Loading…
x
Reference in New Issue
Block a user