/gift command help

Discussion in 'Spigot Plugin Help' started by DrSpyros, Jun 26, 2021.

  1. I wanna make a /gift like command that makes it so if you hold an item and type: /gift [playername], it sends that item to that player as a gift, but I have no idea how to do it plz help
  2. Hey, when the command /gift is executed, you can get the "target" (player you want to gift) by using
    "Bukkit.getPlayerExact(args[0]);" make sure the target is not null. To finish this, you add it to the targets inventory. "target.getInventory().addItem(player.getInventory().getItemInMainhand()).
  3. He wrote the same thread yesterday.
  4. Oh, I wasn't aware of that, my bad :p
  5. Thank you a lot :D
  6. No problem :)