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

Create Block

Comments in 'Plugin Development' started by L1nux, Sep 28, 2013.

  1. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    How can i create block?
    I use:
    PHP:
    $block = new Position($p->entity->x$p->entity->y$p->entity->z$level);
    $p->level->setBlock($blockBlockAPI::get(WOODEN_PLANKS$this->meta), truefalsetrue);
    But this code is not working :(
  2. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    needs to be a vector3 instead of postition.
    PHP:
    $block BlockAPI::get($id$meta);
    $pos = new Vector3($x,$y$z);
    $level->setBlock($pos$block); 
    Last edited: Sep 29, 2013
  3. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    what is "$id, $meta"
    i want add a wooden block, plz example :3
  4. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    L1nux likes this.
  5. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    Thx, i made a hide'n'seek...
    i alredy made a paintball (like hypixel), RPG and more servers... :3
  6. InusualZ
    Offline

    InusualZ Active Member Plugin Developer

    Joined:
    Aug 23, 2013
    Posts:
    218
    Plugins:
    1
    Minecraft User:
    Inusu4lZ
    why just not trigger the event player.block.place
  7. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    blocks create, but dont move :((((
  8. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    what do you mean with "don't move" ?
  9. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    block is created by coordinates Player
    but does not move the player (i made a hide'n'seek)
  10. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    ofcourse it does not move the player, this code is for placing blocks :D
  11. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    ok, how can i make a move blocks :D
  12. InusualZ
    Offline

    InusualZ Active Member Plugin Developer

    Joined:
    Aug 23, 2013
    Posts:
    218
    Plugins:
    1
    Minecraft User:
    Inusu4lZ
    when the player move, move the block and replace the old block with air :)
  13. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX
    plz example :3
    how better to do?
    ---
    getBlock(new Vector3 ($block->x, $block->y, $block->z));
    setBlock(AIR);
    (my reasoning)
    ---
    how can i get block and replace with air?
  14. L1nux
    Offline

    L1nux Banned

    Joined:
    Aug 27, 2013
    Posts:
    17
    Minecraft User:
    EkiFoX

Share This Page

Advertisement