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
    I need help I learned php but I don't understand the pocket mine api please help. I tryed to make a plugin but I get always errors. Thanks for the help
    PHP:
    <?php
    namespace TheMassage;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Commamd;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Command;
    use 
    pocketmine\comandExecutor;
    use 
    pocketmine\Player;
    class 
    TheMassage extends PluginBase {
    public function 
    onEnable() {}
    public function 
    onDisable() {}
    public function 
    onCommand(CommandSender $senderCommand $command$label, array $args) {
        if(
    strtolower($command->getName("setBlock"))) {
            
    $sender->sendMessage("heloo");
            }}}
    ?>
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    <?php
    namespace TheMassage;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Commamd;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Command;
    use 
    pocketmine\comandExecutor;
    use 
    pocketmine\Player;
    class 
    TheMassage extends PluginBase {
    public function 
    onEnable() {}
    public function 
    onDisable() {}
    public function 
    onCommand(CommandSender $senderCommand $command$label, array $args) {
        if(
    strtolower($command->getName("")) == "setblock") { // change to this
            
    $sender->sendMessage("heloo");
            }}}
    // remove ?>, you don't need it
    MyAJVideo likes this.
  3. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Thank you verry much I'm trying to make a plugin which sets a block right under you so is there a way to set a block ?
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    That won't cause errors though
  5. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    It did what you sed and it still gives an error

    Attached Files:

  6. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    use pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\CommandExecutor;
    use 
    pocketmine\Player;
    not
    PHP:
    use pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Commamd//Typo
    use pocketmine\command\CommandSender;
    use 
    pocketmine\Command//remove
    use pocketmine\comandExecutor//Typo
    use pocketmine\Player;
  7. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Typo ? What do you mean with that ?
  8. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
  9. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    The writing of the Words are not the correct
  10. MyAJVideo
    Offline

    MyAJVideo Active Member

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

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
  12. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    It works now but the command is not there so when I do /setBlock it says no such command use /help ? What's wrong now ? @CraftYourBukkit
  13. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
  14. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    @Legoboy0215 yes maybe the setStone but I will look into that when I am getting the command right and stuff.
  15. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    <?php
    namespace TheMassage;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\CommandExecutor;
    use 
    pocketmine\Player;
    class 
    TheMassage extends PluginBase {
    public function 
    onEnable() {}
    public function 
    onDisable() {}
    public function 
    onCommand(CommandSender $senderCommand $command$label, array $args) {
        switch(
    $command->getName()){
            case 
    "setblock":
                 
    $sender->sendMessage("heloo");
                 return 
    true;
    }}}
  16. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Legoboy0215 likes this.
  17. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
  18. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    1.5 is the newest version for 0.11.0
  19. MyAJVideo
    Offline

    MyAJVideo Active Member

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

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010

Share This Page

Advertisement