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

SetBlock()

Comments in 'Plugin Development' started by TryoneLegendZzz, Oct 15, 2015.

  1. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    how can i get a certain block in a world and set it to something else?
  2. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Pretty simple, really:
    PHP:
    $block $level->getBlock($where); //old block
    $level->setBlock($block->getPosition(), Block::get($id$metadata)); //to new block, id and metadata is yours to edit
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Simply pass $block. It is already the position.

Share This Page

Advertisement