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

Hoe to run a command when player does sh..

Comments in 'Plugin Development' started by Muqsit, Apr 29, 2016.

  1. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    How do I run a command when a player MOVES an item from a chest inventory to their inventory?
    Skullex likes this.
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    I have not tried this yet, but I would say it is:
    PHP:
    public function onTransaction(InventoryTransactionEvent $event){
     
    $command "time set day";
     
    $this->getServer()->dispatchCommand(new CommandSender(), $command);
    }
    MikkiMCPE, Skullex and Muqsit like this.

Share This Page

Advertisement