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

Gravity Problem

Comments in 'Plugin Development' started by GamesLoad, May 22, 2016.

  1. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    Hello I wanted to know how to solve problem related to the gravity of the sand I can not make her give up when I try to delete a below by this command block
    $ LV> setBlock (new Vector3 (146,7,172), Block :: get (0));
  2. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Do you mean that you are having trouble with setting block?
    Last edited: May 22, 2016
  3. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    PHP:
    $air = new Block(0);
    $LV->setBlock(new Vector3(146,7,172), $air);
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    I assume that the Sand block falls down after removing block below it. To solve it, you must not trigger block update!

    Look at function documentation here
    PHP:
    \pocketmine\level\Level::setBlock  Vector3  $pos,
      
    Block  $block,
      
    $direct false,
      
    $update true 
      
    )  

    Still no idea what I'm talking about? Just take this code
    PHP:
    $level->setBlock(new Vector3(146,7,172), Block::get(0), truetrue); // If you're touching only one block, set $direct to true
    There is no need to construct new Block instance (bad practice). Use Block::get() instead.

Share This Page

Advertisement