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

new to making plugins

Comments in 'Plugin Development' started by MyAJVideo, May 16, 2015.

  1. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Cool. Line 8 doesn't seem to have any problems, as I see it.
  3. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
  4. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    I had the same problem once when I was programing php and I don't remember how I fixed it
  5. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    I have got it but the namecpase seems to be wrong ( console says)
    PHP:
    <?php
    namespace TheMassage;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Plyer;
    use 
    pocketmine\command\Command;
    class 
    TheMassage extends PluginBase{
    public function 
    onEnable(){}
    public function 
    onDisable(){}
        public function 
    onCommand(CommandSender $senderCommand $command$label, array $args){
            switch(
    $command->getName()){
                case 
    "setblock":
                    if(
    $sender instanceof Player){
    $sender->sendMassage("Heloo");}}}}
    ?>
    HotFireyDeath likes this.
  6. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    This is what the console answers

    Attached Files:

  7. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Okay, I have fixed up the project for you, it now works.
    Either use the attached version, or fix your current version with the code below:

    TheMassage.php
    Code:
    <?php
    namespace TheMassage;
    
    use pocketmine\plugin\PluginBase;
    use pocketmine\command\CommandSender;
    use pocketmine\Player;
    use pocketmine\command\Command;
    
    class TheMassage extends PluginBase{
    public function onEnable(){
        $this->getLogger()->info("TheMassage has been enabled!");
    }
    public function onDisable(){
        $this->getLogger()->info("TheMassage has been disabled!");
    }
        public function onCommand(CommandSender $sender, Command $command, $label, array $args){
            switch($command->getName()){
                case "setblock":
                    if($sender instanceof Player){
                        $sender->sendMessage("Hellooo!");
                    }
                    else{
                        $sender->sendMessage("This command must be run as a player!");
                    }
                return true;
            }
        return false;
        }
                    
    }
    
    plugin.yml
    Code:
    name: TheMassage
    main: TheMassage\TheMassage
    version: 1.0.0
    api: 1.0.0
    author: MyAJVideo
    
    commands:
     setblock:
      description: Says hellooo!
      usage: /setblock
      permission: TheMassage.setblock
    ---
    
    I would recommend you to use the attached version, as it is more of a clean setup and that it is basically fixed the right way.

    Attached Files:

    PEMapModder likes this.
  8. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    If you could tell me what i did wrong your the best ! @HotFireyDeath
  9. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Tryed it it says command not found use /help
  10. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
  11. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    @hotFieryDeath it still don't works when I put the command in console or Player it says unknown command use /help ? What is wrong now ?
  12. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    Its a Extern Server
  13. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    What do you mean ?
  14. TigerHix
    Offline

    TigerHix Active Member

    Joined:
    May 11, 2015
    Posts:
    61
    Minecraft User:
    TigerHix
    Ahhh.. not having the concept of PHP is not a problem, but at least please discuss the matter without showing your impatient.

    You typed others' names wrong, you posted double/triple/quadruple replies, yet the only gratitude you have shown to these helpful guys is a dull-and-dry "OK thank you". I am not sure that whether you are not a native English speaker, or just a little bit young thus couldn't realize that some people may find that offensive.

    And to your problem, please describe things in details. Did you get an expected result that console would print a message of "TheMassage is enabled!" on startup due to your onEnable() method, or simply the plugin was never load? We cannot determine that from your context, therefore if you are willing to provide more information such as console log, or some personal observations of the issues on your own, and merge your one-liner posts into one, we'll already be grateful from the point of view as respondents.
    HotFireyDeath and PEMapModder like this.
  15. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Are you trying to attack me !? I think I am totally wrong and I am trying to learn to help others not only for my own use please go on and ask @Falk he is a friend of mine and he will tell you that I am not doing this without any "giving" I'm not trying to sound agressiv. Nr 2 I'm American but live in Germany. nr3 I feel verry bad when not giving stuff back! Once I asked a friend for something and I hadn't got time to give him something back some people would walk away I am the on who stays and gives stuff back !
    I have many issues I wont discuss with "strangers" but I I can say I am not happy with my life so I'm trying to make other people happy instead of me
    I am not trying to sound like I would (I don't no the word for mitleid (this is German) in English ) thank you for saying something that I could say something like that
  16. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    its a 192.168.x.x Server or other IP
  17. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    Oh du redest ja deutsch wie geht die IP 192.168.örgendwas.örendwas oder eine andere
  18. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Also in der console ja aber ich hab sie geändert zu zombieprison.ddns.net
    Geht aber ned weil ich ihn aus habe
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Don't tell me that this is English.
    1. Many people will consider you "threatening" by talking about all those "@Falk he is a friend of mine" etc.
    2. We are complaining about you posting 5 consecutive posts. As this place is a forum not an InstantMessaging website, each post takes up like a screen worth of space, even on a computer. And your messages were merely meaningless mentioning of names, bumping threads and asking "What do you mean", which all of them can be merged into one post. And please don't make posts to summon someone, because posting an extra post saying someone's name after posting another post is useless in getting the help you want. And it affects the convenience of browsing.
    3. So what did you give back in this case?
    4. Stop complaining. If you think we are strangers, don't even post here if you think we can't be trusted to even talk with.
  20. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    I don't know this forum very good so I have no idea how it works I thought if I post something they would not get an alert.
    Now what I what to give back I want to know how to programm plugins to help others like you do or help writing other plugins.
    I am 15 so I live in Germany and here we have to go to a job for a week and I am really interested in programming programs and websites all that.
    Do you know these people who get bullied all the time and still try to do something in there life ? I am that guy !
    I don't know if you tried to attack me with your post so I wont say anything against it or you.
    I see that 2 other people have liked this and if you don't want to help then don't and I will leave if no one what's me here .

Share This Page

Advertisement