I transcribed 1.4 things to 1.2, and entityDamageByEntityEvent can not execute it. Error Code: Code: Could not pass event 'pocketmine\event\entity\EntityDamageByEntityEvent' to 'TeaSpoon v1.0.0': Call to undefined method pocketmine\event\entity\EntityDamageByEntityEvent::getModifier() on CortexPE\handlers\EnchantHandler 2018-07-24 [08:28:02] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\event\entity\EntityDamageByEntityEvent::getModifier()" (EXCEPTION) in "TeaSpoon-master/src/CortexPE/handlers/EnchantHandler" at line 123 Plugin PHP: PHP: public function onDamage(EntityDamageEvent $ev){ $e = $ev->getEntity(); if($ev->isCancelled()){ return; } if($ev instanceof EntityDamageByEntityEvent){ $d = $ev->getDamager(); if(!($d instanceof Entity) || !$d->isAlive()){ return; } if($d instanceof PMPlayer && $e instanceof Living){ $i = $d->getInventory()->getItemInHand(); $damage = $ev->getModifier(EntityDamageEvent::MODIFIER_ARMOR); $knockback = $ev->getKnockBack(); foreach(Utils::getEnchantments($i) as $ench){ $lvl = $ench->getLevel(); switch($ench->getId()){ case Enchantment::FIRE_ASPECT: $e->setOnFire(($lvl * 4) * 20); break; case Enchantment::KNOCKBACK: $ev->setKnockBack(($knockback + 0.3) * $lvl); break; case Enchantment::PUNCH: if($d->getInventory()->getItemInHand()->getId() == Item::BOW){ $ev->setKnockBack(($knockback + 0.2) * $lvl); } break; case Enchantment::BANE_OF_ARTHROPODS: if(Utils::in_arrayi($e->getName(), self::BANE_OF_ARTHROPODS_AFFECTED_ENTITIES)){ $ev->setModifier($damage + ($lvl * 2.5), EntityDamageEvent::MODIFIER_ARMOR); } break; case Enchantment::POWER: if($i->getId() == Item::BOW){ $ev->setModifier($damage + ((($damage * 0.25) * $lvl) + 1), EntityDamageEvent::MODIFIER_ARMOR); } break; case Enchantment::SMITE: $ev->setModifier($damage + ($lvl * 2.5), EntityDamageEvent::MODIFIER_ARMOR); break; case Enchantment::SHARPNESS: $ev->setModifier($damage + (($lvl * 0.4) + 1), EntityDamageEvent::MODIFIER_ARMOR); break; } } Server Software basic 1.2 EntityDamageByEntityEvent file.
EntityDamageEvent::getModifier() and relevant methods weren't implemented until May of this year, quite a while after the version you're currently using. This means you need to no longer use getModifier and instead use getDamage(EntityDamageEvent::MODIFIER_ARMOR). I'm not sure why you want to use such an old version, because it'll be a pain to revert all the API changes in your plugin.
My server is version 1.2, and plugins were solved with AllAPPLoader. Soo no problem i just need to have the enchant and I can not solve it with mas plugin. There are other plugins, only the more problems this is the easy one.
I doubt very much you are going to get any help with such a messy setup. There's no telling what bad side-effects you'll have using AllAPILoader to force recent plugins to run with such an outdated version of PocketMine, and nobody in their right mind is going to waste time fixing Teaspoon for that; you could revert all the changes since 1.2, but you'll lose all the fixes that were made since.