Skip to content

Instantly share code, notes, and snippets.

@jojoe77777
Created June 20, 2017 08:37
Show Gist options
  • Save jojoe77777/bf7d11564a43d83de4eef15bc1cda691 to your computer and use it in GitHub Desktop.
Save jojoe77777/bf7d11564a43d83de4eef15bc1cda691 to your computer and use it in GitHub Desktop.
if ($ev->isCancelled()) return;
$didItWork = "No";
$isInvalid = "No";
$asConsole = "No";
$taker = $ev->getEntity();
$giver = $ev->getDamager();
if (!($taker instanceof Player)){ $takerSaveId = $taker->getSaveId(); }
if (($taker instanceof Player)){ $takerSaveId = "Player"; }
if(($takerSaveId == "Human")){ if(!$giver->hasPermission("slapper.hit")){ $didItWork = "Yes"; } $ev->setCancelled(); }
if(($takerSaveId == "Item")){ $isInvalid = "Yes"; }
if($isInvalid == "No"){
if(!($ev instanceof EntityDamageByChildEntityEvent)){
if(!($ev instanceof EntityDamageByBlockEvent)){
if (($taker instanceof Player)) return;
if(!($takerSaveId == "Human")){ $isInvalid = "Yes"; }
$takerName = $taker->getName();
// lost the rest of it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment