Drop item from player?

Discussion in 'Plugin Development' started by Kepler_, Aug 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    How can I drop an item from a player as if the player hit the drop item key? I don't know the location to drop the item from or how to drop the item in the direction the player is facing.
  2. Offline


  3. Offline


    That's mostly working. The only problem I'm having is that the item isn't dropping in the right direction.
    Here's my code:
    player.getInventory().setItem(InventoryView.OUTSIDE, toDrop);
  4. Offline


    Use the .dropItemNaturally(ItemStack i) method from the World class. You can even store the item in an entity and use all the entity methods (setVelocity(), etc).
Thread Status:
Not open for further replies.

Share This Page