<?php namespace ItemModifier\UnknownCod; use pocketmine\event\entity\EntityDamageByEntityEvent; use pocketmine\event\Listener; use pocketmine\player\Player; use pocketmine\plugin\PluginBase; class ItemModifier extends PluginBase implements Listener { public function onHit(EntityDamageByEntityEvent $event) { $damager = $event->getDamager(); $target = $event->getEntity(); if($damager instanceof Player && $target instanceof Player){ $item = $damager->getInventory()->getItemInHand(); if($item->getId() == $this->getConfig()->get("Item1") && $item->getMeta() == $this->getConfig()->get("Meta1")){ $event->setBaseDamage(($this->getConfig()->get("damage1"))); } elseif($item->getId() == $this->getConfig()->get("Item2") && $item->getMeta() == $this->getConfig()->get("Meta2")){ $event->setBaseDamage($this->getConfig()->get("damage2")); } elseif($item->getId() == $this->getConfig()->get("Item3") && $item->getMeta() == $this->getConfig()->get("Meta3")){ $event->setBaseDamage($this->getConfig()->get("damage3")); } elseif($item->getId() == $this->getConfig()->get("Item4") && $item->getMeta() == $this->getConfig()->get("Meta4")){ $event->setBaseDamage($this->getConfig()->get("damage4")); } elseif($item->getId() == $this->getConfig()->get("Item5") && $item->getMeta() == $this->getConfig()->get("Meta5")){ $event->setBaseDamage($this->getConfig()->get("damage5")); } } } }