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

Move blocks

Comments in 'Plugin Development' started by Angelo Vidrio, Feb 22, 2015.

  1. Angelo Vidrio
    Offline

    Angelo Vidrio Active Member Plugin Developer

    Joined:
    Jan 16, 2014
    Posts:
    123
    Plugins:
    5
    Minecraft User:
    LilCrispy45
    Ok, I made a post before about moving a blocks "position" to a different x, y, and z. But now, I want to be able to move a block as if the block was a player. Is there any way to make a block move smoothly without setting its coords and just setting the previous coords to air?
  2. luca28pet
    Offline

    luca28pet Active Member

    Joined:
    Feb 20, 2014
    Posts:
    251
    Minecraft User:
    luca28pet
    Let's say you want to move a block from: 130, 10, 128 to 130, 20, 128.
    That is pretty easy because the movement is on an axis only (in this case, only in the y axis):
    PHP:
    $this->moveBlock($block, new Vector3(13020128));
    public function 
    moveBlock(Block $bVector3 $to){
      for(
    $i $block->y$i <= $to->y$i++){
        
    $this->getServer()->getLevelByName("rand")->setBlock(new Vector3($b->x$i$b->z), $b);
        
    $this->getServer()->getLevelByName("rand")->setBlock(new Vector3($b->x$i 1$b->z), Block::get(00));
      }
    }
    BUT if the movement is more complex, like from 129, 20, 128 to 151, 23, 123 then I don't know how to do this :(
  3. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    702
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    I do not know at all, but you can ask that person

  4. Angelo Vidrio
    Offline

    Angelo Vidrio Active Member Plugin Developer

    Joined:
    Jan 16, 2014
    Posts:
    123
    Plugins:
    5
    Minecraft User:
    LilCrispy45
    When you do this it sets the old block to air, which I can already do,
    I have already achieved this, i just want to be able to make it look smooth
  5. Angelo Vidrio
    Offline

    Angelo Vidrio Active Member Plugin Developer

    Joined:
    Jan 16, 2014
    Posts:
    123
    Plugins:
    5
    Minecraft User:
    LilCrispy45
    Never mind, I have found a way ;) Here comes a public BlockHunt plugin

Share This Page

Advertisement