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

Tree growing

Comments in 'Plugin Development' started by Falk, Nov 3, 2013.

  1. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I can't get my head around growTree function in the TreeObject. Has anyone used this in a plugin?
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Still can't figure out how to pass the information to the function :(
  3. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    PHP:
    $level $this->api->level->get('world'); // the level object
    $position = new Vector3(12864128); // the position of the lowest wood block in a vector3 object
    $random = new Random(); // To generate a random tree, you can use the same value for making the same trees
    $type 0// 0 for oak tree, 1 for spruce tree, 2 for birch tree
    TreeObject::growTree($level$position$random$type); // grow the tree
    I made a simple auto tree re-generator with it, it may help https://github.com/wiezz/AutoTree
    Falk likes this.
  4. 0becca0
    Offline

    0becca0 New Member

    Joined:
    Oct 4, 2013
    Posts:
    133
    Minecraft User:
    0becca0
    trees in my server grow just fine and normal with saplings.
  5. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    Yes, but on big servers their are problems with players who cut all the wood and don't plant the saplings again
  6. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Thanks!
  7. TrilogiForce
    Offline

    TrilogiForce Ban Evader Banned

    Joined:
    Sep 7, 2013
    Posts:
    228
    Minecraft User:
    TrilogiForce
    what does the fox say?!?
    ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding ding
  8. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Wow, just wow :p
  9. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    On the github and i copy all of it and put it in plugin folder sart server and it say erroe "$z"
  10. 0becca0
    Offline

    0becca0 New Member

    Joined:
    Oct 4, 2013
    Posts:
    133
    Minecraft User:
    0becca0
    oohhh yes I get it now sorry wies! I dodnt think aboit that. thats a amazibg plugin btw ill be using it then so it will regenerate all trees selected that are cut down?
  11. 0becca0
    Offline

    0becca0 New Member

    Joined:
    Oct 4, 2013
    Posts:
    133
    Minecraft User:
    0becca0
    lol wow >_<
  12. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    bug is fixed now, but it's just an example, not a plugin to use on a server.

Share This Page

Advertisement