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

[Old API] [Tutorial] Plugin Making Section 2

Comments in 'Plugin Development' started by Glitchmaster_PE, Nov 12, 2013.

?

Like the second part?

  1. Yes

    40 vote(s)
    93.0%
  2. No

    3 vote(s)
    7.0%
  1. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    You should create a github pages site for this... :) I could help!
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Just don't use the word "advertize". It makes me feel really bad.
  3. Baspla
    Offline

    Baspla New Member

    Joined:
    Jan 18, 2014
    Posts:
    2
    Minecraft User:
    Baspl
    I love your tutorials and would appreciate it, if there woould be more lessons in the future! ;)
  4. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    I plan on adding some when I get time
    Baspla likes this.
  5. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Sorry, you fine buddy :D
  6. Tiemo2000
    Offline

    Tiemo2000 Active Member

    Joined:
    Nov 23, 2013
    Posts:
    86
    Minecraft User:
    Tiemo2000
    @Glitchmaster_PE can you check my codes? Im changing the command /spawn to /back

    PHP:
    __PocketMine Plugin__
    name
    =Lobby Command
    version
    =1.0
    description
    =Changing /spawn to /back
    author
    =Tiemo2000
    class=Lobby
    apiversion
    =10
    */
    class 
    Lobby implements Plugin{
    private 
    $api;
    public function 
    __construct(ServerAPI $api$server false){
    $this->api $api;
     
    }
    public function 
    init(){
    $this->api->console->register("back","TP's you back to the lobby!",array($this"back");
    $this->api->ban->cmdWhitelist("back");
    $this->api->console->alias("back""spawn");
                                 
    }
    public function 
    back($cmd$issuer){
    $this->api->ban->cmd("back");
     
    }
    public function 
    __desctruct(){
     
    }
                                 
    }
                                 
  7. Tiemo2000
    Offline

    Tiemo2000 Active Member

    Joined:
    Nov 23, 2013
    Posts:
    86
    Minecraft User:
    Tiemo2000
    I know that i must add some extra lines for /* etc but i can't copy it
  8. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    It had a couple errors, try this:
    PHP:
    /*
    __PocketMine Plugin__
    name=Lobby Command
    version=1.0
    description=Changing /spawn to /back
    author=Tiemo2000
    class=Lobby
    apiversion=10
    */
    class Lobby implements Plugin{
    private 
    $api;
    public function 
    __construct(ServerAPI $api$server false){
    $this->api $api;
    }
    public function 
    init(){
    $this->api->console->register("back","TP's you back to the lobby!",array($this"back");
    $this->api->ban->cmdWhitelist("back");
    $this->api->console->alias("back""spawn");
                                
    }
    public function 
    back($cmd$issuer){
    $this->api->console->run("/spawn",$issuer);
    }
    public function 
    __desctruct(){
    }
                                
    }
  9. Tiemo2000
    Offline

    Tiemo2000 Active Member

    Joined:
    Nov 23, 2013
    Posts:
    86
    Minecraft User:
    Tiemo2000
    Are you sure its works?.
  10. Tiemo2000
    Offline

    Tiemo2000 Active Member

    Joined:
    Nov 23, 2013
    Posts:
    86
    Minecraft User:
    Tiemo2000
    (I can't test it out now......:()
  11. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    No.
  12. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    It can't be posted on the forums, it is nothing more than an alias. Plugins on the forums have to do more than that. (Also, the reviewers don't like $this->api->console->run(); )
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Basically you just need the line $this->api->console->alias("back", "spawn"); and everything is done.
  14. Tiemo2000
    Offline

    Tiemo2000 Active Member

    Joined:
    Nov 23, 2013
    Posts:
    86
    Minecraft User:
    Tiemo2000
    I dont post it...... But i use it for my minigame server the command /back teleports you to the spawn (my lobby)
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Can you explain a bit about player.interact data?
  16. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Me? I think wies can explain handlers better than I can
  17. KnownUnown
    Offline

    KnownUnown Active Member Plugin Developer

    Joined:
    Aug 22, 2013
    Posts:
    65
    Plugins:
    1
    Minecraft User:
    KnownUnown
    ^bee doo, @wies, please come and display your helpful input :D^
    PEMapModder likes this.
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The trouble about "player.interacct" event is that the $data is directly raw from the packets?
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I can find $data["entity"] from lines below it but cannot find the attacker.
  20. Baspla
    Offline

    Baspla New Member

    Joined:
    Jan 18, 2014
    Posts:
    2
    Minecraft User:
    Baspl
    Could somebody tell me what variables are inside this $data thing!

Share This Page

Advertisement