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

Breaking the whole tree?

Comments in 'Plugin Development' started by JonsMC, Nov 23, 2016.

  1. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
    is it possible that if we break a tree, it break the whole tree? If so, can i have an example?
  2. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    Please note that if you want further advice on how to do this OR more advice NOT by me please go to https://forums.pmmp.io/
    most members arent active here but if can do with just my advise then here you go

    Firstly you would create an event handler for when a wood block is broken

    when trigger get the block's pos and now get the blocks around it
    if it is wood break + drop it and get the pos around that wood
    optionally do it for leaves
    HimbeersaftLP likes this.
  3. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
    Get blocks around it using loops?
  4. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    well
    something like:
    Code:
    clearStuff($tile){
    if($tile !is Wood OR $tile !is Leave) return;
    tile -> drop & remove
    tile get surroundings
    for (surroundings as surrounding) {
     if(surrounding is wood OR leave) clearStuff(surrounding);
     }
    }
    
    You would call that when a wood is broken so all wood surrounds it should be broken too since it calls itself if there is wood
  5. SamGamgee55
    Offline

    SamGamgee55 Active Member

    Joined:
    Sep 29, 2016
    Posts:
    52
    Minecraft User:
    SamGamgee55
    Please discuss this on the new forums. Thanks!!!
  6. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    Please dont repeat repeated messages. thanks!
    i apriciate you trying to redirect people but it is not like i never said anything about it so please dont repeat it when someone already said about that on a thread
    HimbeersaftLP likes this.

Share This Page

Advertisement