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

Solved sendBlocks error

Discussion in 'Development' started by Aviv, Jun 6, 2017.

  1. Aviv

    Aviv Baby Zombie

    Messages:
    156
    This is so strange... Your method worked! (I mean @Muqsit 's method ;))

    Problem solved, you can use these methods if you have the same problem
    PHP:
    $pk = new \pocketmine\network\mcpe\protocol\UpdateBlockPacket();
    $pk->blockId 54;
    $pk->blockData 0;
    $pk->= (int) $player->x;
    $pk->= (int) $player->2;
    $pk->= (int) $player->z;
    $pk->flags UpdateBlockPacket::FLAG_NONE;
    $player->dataPacket($pk);
    and
    PHP:
    $block Block::get(54);
    $block->$player->getFloorX();
    $block->$player->getFloorY() -2;
    $block->$player->getFloorZ();
    $block->level $player->level;
    $player->level->sendBlocks([$player],[$block]);
    Thank you all for the 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.