The PlayerInventory interface has all the methods you need. Have a look at some of them, and see if you can't figure out which to use. Of course you need to get the player's inventory before you can manipulate it, but that is fairly straight-forward