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

Can't remove used Shovel from inventory

Comments in 'Plugin Development' started by Kvetinac97, Jun 22, 2015.

  1. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Hi.

    In my plugin, player uses some commands for giving/removing items to/from your inventory.

    Player received Iron Shovel (ID 256). He has broken some blocks with it, and when I want to remove this Shovel from his inventory, I use:

    $player->getInventory()->removeItem(Item::get(256));

    but used shovel isn't removed (unused is removed)

    What should I add to remove used shovel too?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    HACK: Try using
    PHP:
    $player->getInventory()->removeItem(Item::get(256null))
    instead.
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Ale víš že když bude mít třeba i svou lopatu tak mu to může smazat tu jeho :D
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Use English please.
    Creeperface likes this.

Share This Page

Advertisement