Hey guys, i thought i might post this as a lot of people have been wondering how to do this! Note: this is in CERTAIN areas!! If u want to disable it throughout the server, modify the server.properties Here is the code: PHP: public function onEntityDamageByEntity(EntityDamageEvent $eventPvP){ if($eventPvP instanceof EntityDamageByEntityEvent){ if($eventPvP->getEntity() instanceof Player && $eventPvP->getDamager() instanceof Player){ $player = $eventPvP->getDamager(); //If statement here $eventPvP->setCancelled(); //Prevent Default Action $player->sendMessage("You are in a No-PVP Zone!"); } }} Let me know if i helped you!
Lol ik, but in certain areas LOL (I use this in my server to stop PvP in certain areas, look for yourself! IP: samcraft.zapto.org ) Omg how DUMB do you think I AM??? I have been running servers and developing for years!!!