Is there a way to completely disable an enchantment's ability? You can still enchant it, but it does nothing.
In case of Weapon and Protection enchantments, you can override the registered enchantments with your own objects. Create new class DisabledProtectionEnchantment extending ProtectionEnchantment. Override isApplicable and simply return false. Having the class done, create multiple instances with same parameters as it's predecessor and register it to finish disabling it (see Enchantment::registerEnchantment()). Repeat similar steps for next enchantments, however there are some that can't be disabled this way because their implementations are scattered throughout the source. One common thing these all implementations have, is to check for enchantment existence on the item, by calling Item::hasEnchantment() method, and then carrying out the modifications accordingly. If you could somehow override the method and return false instead, it would disable rest of enchantments. However it can't be done as Reflections does not allow to do that, and any other options I've considered disables enchantments on a client side as well. (see Enchantment::init())
You can make this with events too: PHP: <?phpnamespace test;use pocketmine\event\Listener;use pocketmine\plugin\PluginBase;use pocketmine\event\player\PlayerItemHeldEvent;use pocketmine\event\player\PlayerInteractEvent;use pocketmine\Player;class test extends PluginBase implements Listener { public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function noEnchant(Player $player) { foreach($player->getInventory()->getContents() as $item) { if(count($item->getEnchantments()) != 0) { foreach($item->getEnchantments() as $enchant) { $item->removeEnchantment($enchant->getId()); } } } } public function itemHeld(PlayerItemHeldEvent $event) { $this->noEnchant($event->getPlayer()); } public function itemUse(PlayerInteractEvent $event) { $this->noEnchant($event->getPlayer()); }}