Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove Item from Inventory

Comments in 'Plugin Development' started by Sensej, Jul 4, 2015.

  1. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    Hello, how can i remove only ONE items from a Player Inventory?

    For example the player has 3 stone blocks and i want to remove only 1 so that he have later only 2 stone block.
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    $item Item::get($id$damage$count);
    $player->getInventory()->remove($item);
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It will delete all occurrences of that item. Use removeItem instead.

Share This Page

Advertisement