I'm using AUtoInv @Jack Noordhuis and teaspoon by @CortexPE I killed a pig and the pork drops to the ground but also goes to your inventory.. it doubles.. i want to stop that pretty sure this is the code to set drops of pigs in TeaSpoon PHP: public function getDrops(): array{ $cause = $this->lastDamageCause; if($cause instanceof EntityDamageByEntityEvent){ $damager = $cause->getDamager(); if($damager instanceof Player){ //$looting = $damager->getInventory()->getItemInHand()->getEnchantment(Enchantment::LOOTING); //if($looting !== null){ //$lootingL = $looting->getLevel(); //}else{ //$lootingL = 0; //} return [ Item::get(Item::RAW_PORKCHOP, 0, mt_rand(1, 3)), ]; } } return []; } and this is the code in Autoinv that add the entity drops to your inventory PHP: public function onDeath(EntityDeathEvent $event) { $victim = $event->getEntity(); $cause = $victim->getLastDamageCause(); if($cause instanceof EntityDamageByEntityEvent) { $killer = $cause->getDamager(); if($killer instanceof InventoryHolder) { foreach($event->getDrops() as $drop) { $killer->getInventory()->addItem($drop); } } } else { $event->setDrops([]); } return; } how can i stop the pork from dropping to the ground? I want it to only go to my inventory straight
AutoInv currently only supports adding player death drops directly to a killers inventory. I’ll add an option in the next few hours to support adding any entities drops directly to a killers inventory.
I've updated AutoInv and you can grab the latest release from poggit. You will have to either delete or manually update your config to be able to use the new options.