I think it should be PHP: public function onInteract(PlayerInteractEvent $event){ $player = $event->getPlayer(); $itemTapped = $event->getBlock(); if($itemTapped->getName() == "chest"){//get the block by name //Open the UI }}