I have this in my MainListener class that is functioning fine: PHP: public function onPickup(InventoryPickupItemEvent $e){ $player = $e->getInventory()->getHolder(); if($player instanceof Player){ if($this->plugin->getArena()->getSpectate()->isSpectating($player)){ $e->setCancelled(true); return; } $item = $e->getItem(); if($item instanceof EffectPickup){ $effect = $item->getEffect(); $player->addEffect($effect); $this->plugin->getServer()->broadcastMessage(TF::LIGHT_PURPLE . "Envoy> " . "Effect Pickup" . "envoy has been claimed!"); } if($item instanceof FreePlay){ $type = $item->getFreePlayType(); $count = $item->amount(); $this->plugin->getKits()->getSession($player)->addFreePlays($type, $count); $player->sendMessage(TextFormat::OBFUSCATED . "||" . TextFormat::RESET . " " . TextFormat::GRAY . "Picked up " . TextFormat::YELLOW . "x".$count." ".$type." Free Play".($count > 1 ? "s" : "").TextFormat::GRAY."! ".TextFormat::WHITE.TextFormat::OBFUSCATED."||"); $this->plugin->getServer()->broadcastMessage(TF::LIGHT_PURPLE . "Envoy> " . "Effect Pickup" . "envoy has been claimed!"); } if($item instanceof CoinCluster){ $mbp = new PvPFestPlayer(); $mbp->addCoins($player, 20); $player->sendMessage(TextFormat::OBFUSCATED . "||" . TextFormat::RESET . " " . TextFormat::GRAY . "Picked up " . TextFormat::AQUA . "20" ." Coins from a coin cluster".TextFormat::GRAY."! ".TextFormat::WHITE.TextFormat::OBFUSCATED."||"); $this->plugin->getServer()->broadcastMessage(TF::LIGHT_PURPLE . "Envoy> " . "Coin Cluster" . "envoy has been claimed!"); } }} CoinCluster, FreePlay and EffectPickup all extend Item and are written like this: PHP: class CoinCluster extends Item{ public function __construct($count = 1){ parent::__construct(self::GOLD_INGOT, 0, "Coin Cluster"); $this->setCustomName(TextFormat::RESET . TextFormat::AQUA . $this->getName()); $this->setCount($count); }} PHP: class EffectPickup extends Item{ public $effect; public function __construct(EffectInstance $effect, $count = 1){ parent::__construct(self::SLIMEBALL, 0, "Effect Pickup"); $this->setCustomName(TextFormat::RESET . TextFormat::AQUA . $this->getName()); $this->setCount($count); $this->effect = $effect; } public function getEffect(){ return $this->effect; }} PHP: class FreePlay extends Item{ public $kit; public $count; public function __construct(string $kit, $count = 1){ parent::__construct(self::MAGMA_CREAM, 0, "Free Play"); $this->setCustomName(TextFormat::RESET . TextFormat::AQUA . $this->getName()); $this->kit = $kit; $this->setCount($count); $this->count = $count; } public function getFreePlayType(){ return $this->kit; } public function amount(){ return $this->count; }} A repeating task drops these items using Level->dropItem() with no errors. However, when I pick these items up in-game, nothing happens. I tried using ItemFactory to register them, but an exception was thrown stating they are already registered and thus I was trying to overwrite them. I tried it again using the 2nd parameter of ItemFactory::registerItem() and setting it to true, but now the first issue happens. Any help? Is this an issue with the Listener or something else?
Yes sir, that's what I have. All of the other events in the listener class are being called with no problem. I'm not using a custom player class either, Player in InventoryPickupItemEvent is normal \pocketmine\Player.
All of the classes I need are imported. It's just this one method in the listener class that seems to either a) not get called, or b) not recognize the picked up item as one of the three in the function, which is why I wasn't sure if I had to manually register them (which didn't seem to help regardless)