PHP: public function eat(PlayerItemConsumeEvent $e){ if($e->getItem()->getId() == Item::STEAK){ // code } }