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

How do I give, take items and see the items in a players inventory?

Comments in 'Plugin Development' started by Hittmana, Jan 28, 2016.

  1. Hittmana
    Offline

    Hittmana Active Member

    Joined:
    Jul 26, 2015
    Posts:
    224
    Minecraft User:
    move_it
    I need to know how to both give and take items from a player. Also I want to know how to see the items in a players inventory. Thanks in advance!
  2. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    There is a thread talking about setting items that's active atm, remove an item with:
    PHP:
    Player::getInventory()->remove(Item::get(000);
    As for seeing items in a players inventory you could create a command that lets you see a players inventory, let's you check a players inventory or lists the items in a players inventory.
  3. Hittmana
    Offline

    Hittmana Active Member

    Joined:
    Jul 26, 2015
    Posts:
    224
    Minecraft User:
    move_it
    How would i create a command to list the items in a players inventory?
  4. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    Look through some plugins, you should learn how to register commands and implement/set their executors if you want to make plugins.
    Hittmana likes this.

Share This Page

Advertisement