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

Items command

Comments in 'Plugin Development' started by Xirano, Aug 22, 2015.

  1. Xirano
    Offline

    Xirano New Member

    Joined:
    Aug 2, 2015
    Posts:
    17
    Minecraft User:
    xirano78
    Hi !i want make plugin for commands on items !
    How can i make this ? :)
  2. basprohop
    Offline

    basprohop Active Member Plugin Developer

    Joined:
    Aug 8, 2015
    Posts:
    128
    Plugins:
    3
    Minecraft User:
    basprohop
    What do you mean? Like /give?
  3. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    o_O what do you mean ?
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    PHP:
    public function onItemHeld(PlayerItemHeldEvent $event){
    if(
    $item->getId() === Item::STICK){
    $command 'me I got stick :3' // You can get this command from config or whatever you want
    $this->getServer()->dispatchCommand($event->getPlayer(), $command); // Dispatch the command;
    }
    }
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The use of Server::dispatchCommand() is discouraged by PocketMine plugin standards.
  6. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Why?
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is slow. You should instead execute the command directly.
  8. Xirano
    Offline

    Xirano New Member

    Joined:
    Aug 2, 2015
    Posts:
    17
    Minecraft User:
    xirano78
    How i use ?
    Using sitck dont work :/ [For Testing]

Share This Page

Advertisement