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. ZombieKiller
    Offline

    ZombieKiller Ban Evader Banned

    Joined:
    Jan 22, 2014
    Posts:
    2
    Minecraft User:
    ZombieKiller
    Awesome tutoriel
  2. Krazykid1117
    Offline

    Krazykid1117 New Member

    Joined:
    Jan 18, 2014
    Posts:
    4
    Minecraft User:
    Krazykid1117
    Is there a way to spawn a primed tnt at the issuers location?
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    EntityAPI::add()
  4. Krazykid1117
    Offline

    Krazykid1117 New Member

    Joined:
    Jan 18, 2014
    Posts:
    4
    Minecraft User:
    Krazykid1117
    I know this is going to sound like a stupid question but, How do you use that command in the code?
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    A line in PHP is called a statement or assignment not a command.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    ServerAPI::request()->api->entity->add($levelObject, $type[, $subType=0[, $data=array()]]);
    With reference to https://github.com/PocketMine/PocketMine-MP/blob/master/src/world/Entity.php#L83 and https://github.com/PocketMine/PocketMine-MP/blob/master/src/API/EntityAPI.php#L104 ,
    Usage:
    PHP:
    #To add a chicken
    $x=WHATEVER;
    $y=WHATEVER;
    $z=WHATEVER;
    $levelName=WHATEVER;
    $api=ServerAPI::request()->api;
    $api->entity->add($api->level->get($levelName), ENTITY_MOBMOB_CHICKEN, array(
        
    "x"=>$x,
        
    "y"=>$y,
        
    "z"=>$z
    ));
    Adrian likes this.
  7. Exequiel Fernando
    Offline

    Exequiel Fernando New Member

    Joined:
    Feb 2, 2014
    Posts:
    3
    Minecraft User:
    Exequielijah111
    Its not working on my pocketmine . :(
  8. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
  9. FlubberDubber
    Offline

    FlubberDubber New Member

    Joined:
    May 24, 2014
    Posts:
    2
    Minecraft User:
    TheJewishRabbitz
    this makes more sense thanks,

    please do a part 3 i really would like to learn how to protect an area :D like!
  10. Adrian
    Offline

    Adrian Active Member

    Joined:
    Jun 26, 2014
    Posts:
    64
    Minecraft User:
    Adrian
    How can you put multiple chickens/animals?
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Do it multiple times of course. Maybe with a for loop.
    Adrian likes this.
  12. Adrian
    Offline

    Adrian Active Member

    Joined:
    Jun 26, 2014
    Posts:
    64
    Minecraft User:
    Adrian
    Thank You ;)
  13. -elfin-
    Offline

    -elfin- New Member

    Joined:
    Mar 19, 2014
    Posts:
    29
    Minecraft User:
    elfin_ARC
    I try run the plugin but always Come error... It said unexpected "{" at line 16, after i fix it, there comes another error... When i fix, more errors keep coming! Help me
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This is what coding is.
  15. -elfin-
    Offline

    -elfin- New Member

    Joined:
    Mar 19, 2014
    Posts:
    29
    Minecraft User:
    elfin_ARC
    Help me please?
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    How?
  17. -elfin-
    Offline

    -elfin- New Member

    Joined:
    Mar 19, 2014
    Posts:
    29
    Minecraft User:
    elfin_ARC
    How can i fix this problem? It always says error unexpected thing at line 16 or line 17.
  18. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    That "thing" is a curly brace, at least that's what I call them :). Post your code here, you may have forgot a semicolen.
  19. -elfin-
    Offline

    -elfin- New Member

    Joined:
    Mar 19, 2014
    Posts:
    29
    Minecraft User:
    elfin_ARC
    Its not my Code, i tried that "opme" code because i wanted to test does it even work before i start making own code
  20. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    You must of pasted something wrong, try copying everything.

Share This Page

Advertisement