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

Help, remove the item from the player's inventory

Comments in 'Plugin Development' started by Barrington, Aug 4, 2015.

  1. Barrington
    Offline

    Barrington New Member

    Joined:
    Jul 31, 2015
    Posts:
    41
    Minecraft User:
    Berrington
    I need to remove a player such as rock.
    That's how it is implemented using the following function ?
    $p->getInventory()->clear();
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    try $inventory->removeItem();
    Barrington likes this.
  3. Barrington
    Offline

    Barrington New Member

    Joined:
    Jul 31, 2015
    Posts:
    41
    Minecraft User:
    Berrington
    thx :)
    Can you tell how to make a certain item can not throw it?
  4. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    do you mean dropItemEvent ?
    Barrington likes this.
  5. Barrington
    Offline

    Barrington New Member

    Joined:
    Jul 31, 2015
    Posts:
    41
    Minecraft User:
    Berrington
    +
  6. Barrington
    Offline

    Barrington New Member

    Joined:
    Jul 31, 2015
    Posts:
    41
    Minecraft User:
    Berrington
    $inventory->removeItem(); <--
    can you tell how to remove the inventory bedrock ?
  7. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    what? do you mean bedrock from inventory?
  8. Barrington
    Offline

    Barrington New Member

    Joined:
    Jul 31, 2015
    Posts:
    41
    Minecraft User:
    Berrington
    I am Russian , and translate through Google .
    I need to delete from the inventory function of the bedrock below
    $inventory->removeItem();
    how to do it?
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
  10. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    When i have 8 stones in one slots And use remove(Item::get(1, 0, 7)) so i will have 1 stone?
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Inventory->remove() is count-insensitive. It will remove all occurrences of that item.
  12. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    I understand russian if you want post what you want in russian i'll try to help :)
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Only English is allowed on non-International Forums.
    Legoboy0215 likes this.
  14. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Can it be Russian then English? :D
  15. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    So how can i remove 8 stones from my inventory?
  16. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    $player->getInventory()->removeItem($slots);
    //Removes the given Item from the inventory. It will return the Items that couldn't be removed. A Player source can be set at the end
    PHP:
    $player->getInventory()->clear($slot$source=null); // Will clear specific slot
  17. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    But i want to remove 8 stones from the inventory
  18. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    So removeItem Remove only specified amount of item?
  19. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    I guess, give it a try
  20. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    But when i have in each slot 1 stone so it wont work

Share This Page

Advertisement