Issue removing item from OffHand.

Discussion in 'Spigot Plugin Development' started by arsenalfcgunners, May 16, 2016.

  1. I use this to remove an item from a player's inventory:

    However, if the arrow is in the offhand slot it is not removed. Anyone know how to fix this?
  2. Get the item in the player's offhand and remove it then?...
  3. I tried that too. Idk if I did it wrong though. This is what I did:
  4. Try this:
    Code (Java):
  5. Didn't work. And just because I know someone will ask me this, yes it is getting called. I verified with a print statement.
    • Friendly Friendly x 1
  6. player.getInventory().setItemInOffHand(new ItemStack(Material.AIR, 1));
    It might be possible to just set it to null, not 100% sure rn.
    • Agree Agree x 2