Why I need to do this: I disable fall damage on my server so players can jump down into maps. I currently edit the phars to do this, however this makes updates very hard. How could I change this using a plugin?
We have a no fall damage plugin, and I even wrote an iprotector edit allowing to disable fall damage in a certain area, the problem is all 3 of these work by disabling fall damage like so: if($ev->getCause() === EntityDamageEvent::CAUSE_FALL) { $ev->setCancelled(); } This is the correct way to this however pocketmine defaultly sets pearls to the fall damage type. A simple work around is editing a the phar to change the damage type to something other than fall damage allowing the no fall damage and the pearl damage to not conflict. I need a way to achieve the same effect with a plug-in, because I'd like to be able to keep my server up to date easily.
the only possible way to do that would be to either check if an EntityTeleportEvent has been triggered immediately before the EntityDamageEvent. (or if a sound has been added at that location, but that is a bit overcomplicated) This is quite a hack solution, but should work well.
i think, get fron projectilehitevent and check whether player has ender pearl, if so set cancelled (on entitydamageevent) or heal.
Yea, is there any benefit having the damage reason fall damage over anything else for pearls? My only problem is I'm having trouble making phars to update my server and I like to update about every other week as long as it doesn't break anything, keeps it easier to know what needs to be updated/already is updated when the next major update comes out.
as per vanilla, ender pearl damage is intended to be treated as fall damage (hence why feather falling enchantment reduces it and such).