In the sever.properties, you'l see there is a PVP option ;P Code: #Properties Config file pvp=on Turn it off. OR if you want php, PHP: public function onPlayerDamage(EntityDamageEvent $event){ $event->setCancelled(true); }
Or u can use EntityDamageEvent PHP: function dm(EntityDamageEvent $e) { if ($e instanceof EntityDamageByEntityEvent) $e->setCancelled(true); }
when a function is in a class it's a method the public private protected is a visibility keyword non declared is implied as public but not recommended see more on http://php.net/manual/en/language.oop5.visibility.php private meaning only $this can access it protected meaning only childrens can access it but not everyone public meaning anyone can access it private/protected is useful to store internal data that you dont want other class to mess with also in PMMP only public functions can be registered to event handler