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

Removing Single Item From Players Hand

Comments in 'Plugin Development' started by elfin8er, Mar 26, 2014.

  1. elfin8er
    Offline

    elfin8er New Member

    Joined:
    Feb 1, 2014
    Posts:
    25
    Minecraft User:
    elfin8er
    I'm trying to remove a single item from the players hand when the player taps on a block. Can't get it to work though.

    PHP:
    public function blockTouchEvent($data$event){
            
    $item $data["item"]->getID();
            
    $player $data["player"];
            if(
    $player->hasItem($itemfalse)){
                
    var_dump($player->removeItem($itemfalse1true));
                return 
    false;
            }else{
                return 
    true;
            }
    }
    It returns "bool(false)", so it's getting to the 5th line. Any suggestions?
    PEMapModder likes this.
  2. elfin8er
    Offline

    elfin8er New Member

    Joined:
    Feb 1, 2014
    Posts:
    25
    Minecraft User:
    elfin8er
    Still can't figure this out. Does anyone know how to do this?

Share This Page

Advertisement