1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Chunk edit

Discussion in 'Plugin Help' started by dragonflex, Feb 5, 2017.

  1. dragonflex

    dragonflex Spider Jockey

    Messages:
    44
    public function generateChunk($chunkX, $chunkZ) {
    $chunk = $this->level->getChunk($chunkX, $chunkZ);
    $chunk->setGenerated();
    if ($chunkX % 20 == 0 && $chunkZ % 20 == 0) {
    for ($x = 0; $x < 16; $x++) {
    for ($z = 0; $z < 16; $z++) {
    $chunk->setBlock($x, 0, $z, Block::BEDROCK);
    for ($y = 1; $y <= 3; $y++) {
    $chunk->setBlock($x, $y, $z, Block::STONE);
    }
    $chunk->setBlock($x, 4, $z, Block::DIRT);
    $chunk->setBlock($x, 5, $z, Block::GRASS);
    }
    Tree::growTree($this->level, $chunkX * 16 + 8, 6, $chunkZ * 16 + 8, $this->random, 0);
    }
    $chunk->setX($chunkX);
    $chunk->setZ($chunkZ);
    $this->level->setChunk($chunkX, $chunkZ, $chunk);
    }
    }
    How edit this to place block end portal and set obsidian to bedrock
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Please use code blocks, thanks

    [PHP]Put your php code here[/PHP]
    or for normal code or files that aren't php:
    [CODE]Put normal code or file content (e.g. configs) here[/CODE]

    I am really getting tired from writing this, can people please get a proper working brain...
     
    jasonwynn10 likes this.
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    So, you want an end portal on the skyblock island with a the bedrock being obsidian?
    PHP:
    public function generateChunk($chunkX$chunkZ) {
            
    $chunk $this->level->getChunk($chunkX$chunkZ);
            
    $chunk->setGenerated();
            if (
    $chunkX 20 == && $chunkZ 20 == 0) {
                for (
    $x 0$x 16$x++) {
                    for (
    $z 0$z 16$z++) {
                        
    $chunk->setBlock($x0$zBlock::OBSIDIAN);
                        for (
    $y 1$y <= 3$y++) {
                            
    $chunk->setBlock($x$y$zBlock::STONE);
                        }
                        
    $chunk->setBlock($x4$zBlock::DIRT);
                        
    $chunk->setBlock($x5$zBlock::GRASS);
                    }
                    
    Tree::growTree($this->level$chunkX 16 86$chunkZ 16 8$this->random0);
                }
                
    $chunk->setX($chunkX);
                
    $chunk->setZ($chunkZ);
                
    $this->level->setChunk($chunkX$chunkZ$chunk);
            }
        }
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.