So, I send a UI on PlayerInteractEvent and when I try to esc from the ui or click on one of the button's I just get the same form again. Any help?
playerinteractevent is called 4 times (multiple times) when right clicking on w10. Put the player in an array and if already in the array, dont send him the form. when he replies to the form, remove the player from the array
PHP: private $players = [];private $wait = 2;public function onInteract(PlayerInteractEvent $event){$player = $event->getPlayer();$item = $event->getItem();if($item->getCustomName === "foo"){$name = $player->getName();if(!isset($this->players[$name]) or time() > $this->players[$name]){$this->players[$name] = time() + $this->wait;//TODO}else{$event->setCancelled();