Hi, How can I remove the item on PlayerInteractEvent, so you can only use it one time? But only one item, if the player has two, he should have one after this.
PHP: /** @type Player $player */$inv = $player->getInventory();$item = $inv->getItemInHand();$item->count--;$inv->setItemInHand($item);
I needed the same thing like you, I just did: $item = new Item(id, damage, amount); then $player->getInventory()->remove($item); and then right after it $player->getInventory()->addItem($item)