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

Solved Check for Item and remove [help]

Comments in 'Plugin Development' started by Survingo, Mar 6, 2016.

  1. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    It's me again >_<
    So, I've finished Item Spawner for BedWars... But now I have troubleshooting with the "Shop".
    How to check if an Player has an specific Item and then remove it?
    PHP:
    $sender->getInventory()->getId(336)->getCount(8)
    // $sender is the guy that wrote command, code right... Maybe wrong lol
    And now remove that item...
    Last edited: Mar 6, 2016
  2. KubixQ
    Offline

    KubixQ Active Member

    Joined:
    Sep 13, 2015
    Posts:
    85
    Minecraft User:
    KubixQ
    check - if()
    Survingo likes this.
  3. TheDeibo
    Offline

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    Basically, like @KubixQ has said.

    The IF statments do most of the work. :)
    take a look at these :) These will help.

    IF STATMENTS
    http://php.net/manual/en/control-structures.if.php
    ELSEIF STATMENTS
    http://php.net/manual/en/control-structures.elseif.php
    Survingo likes this.
  4. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Yeah, but how to remove that specific Item count? I can only code for remove all
  5. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Done #IReadTheDocs :p

Share This Page

Advertisement