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

Solved Spawn block using packet

Discussion in 'Development' started by KHAV, Jul 17, 2018.

  1. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    brokiem and Lolipop78709 like this.
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    It's possible, or at least, it was. I accidentally spawned a piston block a year and a half or so ago while trying to create floating text. I'll try to find some source as proof, but I haven't had any luck yet.
     
  3. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
  4. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    Wrong. Floating text particles are invisible human entities. And your second part is invalid. KHAV would like to use AddEntityPacket. The method for spawning a falling block entity with AddEntityPacket is to send the block variant through the metadata property of AddEntityPacket. Here's an example:
    PHP:
            $pk = new AddEntityPacket();
            
    $pk->entityRunTimeId Entity::$entityCount++;
            
    $pk->type FallingBlock::NETWORK_ID;
            
    $pk->position $player->add($player->getDirectionVector());
            
    $pk->motion = new Vector3(000);
            
    $pk->metadata = [Entity::DATA_TYPE_INT => [Entity::DATA_VARIANTBlockFactory::toStaticRuntimeId(Block::STONE)]];
            
    $player->sendDataPacket($pk);
     
    Last edited: Jul 17, 2018
  5. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    Thx it is working but is it possible to change the size of the block?
     
  6. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    KHAV likes this.
  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.