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

Solved ShrinkBorder ?

Comments in 'Plugin Development' started by Ritch, Aug 21, 2016.

  1. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Hi guys, How to Make ShrinkBorder with a Task ?
    a border that forms a square is decreasing slowly
    Last edited: Aug 22, 2016
  2. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Help ? :c
  3. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
    What do you mean shrink border? Sorry, i don't understand it
  4. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous

    Attached Files:

  5. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    unclear what you're asking
    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking.
    Last edited: Aug 23, 2016
  6. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    a border that forms a square is decreasing slowly
  7. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    we have no way to display a boarder in MCPE. Do you want a fictional border? where players can't through? Because displaying a border like in MCPC 1.9+ (wait since when was it implemented) isn't possible in MCPE (yet)
  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Is that what you want?
    Ritch likes this.
  9. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Not with particle
  10. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Just a shrinkborder not with Particle
  11. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    And what exactly is your "border"? What does this border do?
  12. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Like on hypixel UHC?
  13. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    It Pushes in to the world. Well im pretty sure
  14. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    It narrows as time passes. It is a square world and the boarders move in and close the players in. Think of it as a bit like this.

    Like the walls in that trash room (Sorry for the bit at the start, just skip to 00:39)
  15. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Has no one ever heard of Hypixel UHC
    Last edited: Aug 23, 2016
  16. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Right, like this
  17. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    We are plugin developers, not those stupid server review YouTubers who nothing other than public relations.
    jasonwynn10 and Primus like this.
  18. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Fair point. I dont watch that kind of stuff it is just that I looked it up for an example.
    Last edited: Aug 23, 2016
  19. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    To make a border:
    PHP:
    $borderX 100;
    $borderZ 100;
    $borderY 50;
    $minBorderX 0;
    $minBorderZ 0;
    for(
    $y 0$y <= $borderY$y++){

    for(
    $x 0$x <= $borderX$x++){
    $level->setBlock(new Vector3($x$y$minBorderZ), Block::get(95));

    $level->setBlock(new Vector3($x$y$borderZ), Block::get(95));
    }

    for(
    $z 0$z <= $borderX$z++){
    $level->setBlock(new Vector3($minBorderX$y$z), Block::get(95));

    $level->setBlock(new Vector3($borderX$y$z), Block::get(95));
    }


    }
    As you can see I use the block 95, it's invisible bedrock, which you can't destroy and can't see, but it still blocks you.

    Now we want to shrink it, I am recommending to call a function.

    PHP:

    public function shrinkBorder($x$y$z$minX$minZ){
    // spawn the new shrinkborder
    $borderX $x $this->count;
    $borderZ $y;
    $borderY $z $this->count;
    $minBorderX $minX $this->count;
    $minBorderZ $minZ $this->count;
    for(
    $y 0$y <= $borderY$y++){

    for(
    $x 0$x <= $borderX$x++){
    $level->setBlock(new Vector3($x$y$minBorderZ), Block::get(95));

    $level->setBlock(new Vector3($x$y$minBorderX), Block::get(95));
    }

    for(
    $z 0$z <= $borderX$z++){
    $level->setBlock(new Vector3($minBorderX$y$z), Block::get(95));

    $level->setBlock(new Vector3($borderX$y$z), Block::get(95));
    }


    }
    }


    // you can despawn the old border but I dont recommend you to do that, because it will only take unneccessary proccessing.

    To call the function:

    Make a public variable:
    $this->count = 0;
    Everytime the border shrinks, count $this->count up.

    PHP:
    $this->count++;
    $this->shrinkBorder($x$y$z$minX$minZ);
    $x, $y, $z, $minX, $minZ are free to choose. I hope I could help!
    archie426 likes this.
  20. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    It's probably much more efficient to disallow player movement. It is very inefficient to send a large number of block changes in a short period to many players who would probably never run into the borders.
    Primus likes this.

Share This Page

Advertisement