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

Basics on Commands

Comments in 'Plugin Development' started by DunxandMinecraft, Apr 26, 2015.

  1. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    I am cureating a small plugin and I need help with the perrmittons and the code for plugin. What is the perrmition for making a chat message directly to a ONE player.
  2. iiDeathStrokeii
    Offline

    iiDeathStrokeii Active Member

    Joined:
    Mar 30, 2015
    Posts:
    111
    Minecraft User:
    iiDeathstrokeii
    *Creating* *Permissions*
  3. iiDeathStrokeii
    Offline

    iiDeathStrokeii Active Member

    Joined:
    Mar 30, 2015
    Posts:
    111
    Minecraft User:
    iiDeathstrokeii
    $player =$this->event->getPlayer(); $player->sendMessage("example")
    Martin77Epic and TonyDroidd like this.
  4. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    In the 'plugin.yml' it asks for a perrmition and I want when you run the command it displays a message.
  5. iiDeathStrokeii
    Offline

    iiDeathStrokeii Active Member

    Joined:
    Mar 30, 2015
    Posts:
    111
    Minecraft User:
    iiDeathstrokeii
    I honestly dont understand what your asking...lol just wrap the code above in a command function.... I dont understand what you mean by permissions in a config.yml file
  6. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    Following:
    PHP:
    commands:
    info:
    description"Shows information about the server"
    usage"/info"
    permissionmyplugin.example
    The perm part there what would I write there and how would I implement a chat message to only one player.
    The project: https://github.com/DunxGit/InfComs/
    Martin77Epic likes this.
  7. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Do you know how use the events about commands ?
  8. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    Not really, Sorry :( I'm very new to PHP
  9. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Ok np, i code you an exemple :)
  10. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    Ok, Thanks
  11. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Look at this.

    Attached Files:

  12. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    You don't need perms. Just filter out who receives the message in your onCommand() function. Permissions decide who can run the command.
  13. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    I know x) i've add it for a complete command registration in the plugin.yml.
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You sure? $this->event?

Share This Page

Advertisement