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

Solved How to make blocks go flying

Discussion in 'Development' started by Levi, Jun 12, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    How did he make the blocks go up
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Set motion to an item entity
    PHP:
    /** @var Level $level */
    /** @var Vector3 $pos */

    $item Item::get(Item::QUARTZ_BLOCK);
    $motion = new Vector3(01.50);//will travel 1.5 blocks on the Y axis

    $level->dropItem($pos$item$motion);
     
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    how about opening the chest?
     
  4. Nawaf1b

    Nawaf1b Silverfish

    Messages:
    17
    if player Touch Chest You Can Make It By \pocketmine\event\player\PlayerInteractEvent
     
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    the chest opens itself
     
  6. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    He used playerinteractevent for it
     
  7. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Fake it using packets? If you know the block position, send the following packet to the player:
    PHP:
    /** @var Vector3 $block */
    $pk = new BlockEventPacket();
    $pk->$block->x;
    $pk->$block->y;
    $pk->$block->z;
    $pk->eventType 1;
    $pk->eventData 1;//1=open, 0=close
     
  8. Nawaf1b

    Nawaf1b Silverfish

    Messages:
    17
  9. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    $player->addWindow($inv); should. Work too if u use it right
     
  10. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    stop send same message on two threads it dont help
     
  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.