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

Generate a Tree

Comments in 'Plugin Development' started by xpyctum, Jun 26, 2014.

  1. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Hi, i have a question .
    How i can generate a tree?
    What import (use) i must using?
    I' trying use this, but don't work.
    PHP:
    $pos = new Vector3($pX,$pY,$pZ);
    $type 1;
    $meta Sapling::BIRCH;
    ObjectTree::growTree($pLevel$pos$type$meta);
    Please, help
  2. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Error, or just doesn't work?
  3. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Have an error
  4. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    what is the error?
  5. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    PHP:
    use pocketmine\level\generator\object\Tree;
    use 
    pocketmine\utils\Random;
    //Plugin
    Tree::growTree($level$x$y$z, new Random(mt_rand()));
    You can also set a sixth argument to the tree type (defaults to 0).
    xpyctum likes this.
  6. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Okay, thanks, i'm trying!)
  7. PluginMastered
    Offline

    PluginMastered Active Member

    Joined:
    Mar 1, 2014
    Posts:
    161
    Minecraft User:
    Flexa33
    $myarrayname [0]; <- thhats how??? sorry I forgot :(
  8. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Sorry, what?
    PHP:
    $args[0] =
    This?
  9. PluginMastered
    Offline

    PluginMastered Active Member

    Joined:
    Mar 1, 2014
    Posts:
    161
    Minecraft User:
    Flexa33
    yeah I havnt learned pocketmine api yet
  10. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    It's no change in new API ;)
  11. PluginMastered
    Offline

    PluginMastered Active Member

    Joined:
    Mar 1, 2014
    Posts:
    161
    Minecraft User:
    Flexa33
    I never even learned api 12 and 13 because i was on my server 24/7 but its been offline for 2 weeks and i got time to go to code academy so i can start by going to the dics now

Share This Page

Advertisement