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

Entity move

Discussion in 'Help' started by WoolChannel3295, May 5, 2020.

  1. WoolChannel3295

    WoolChannel3295 Silverfish

    Messages:
    22
    GitHub:
    KietTran0308
    Hi, i need help
    How to add move for entity by code
     
  2. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    if you Entity is Human use MovePlayerPacket() else use MoveActorAbsolutePacket()
     
  3. WoolChannel3295

    WoolChannel3295 Silverfish

    Messages:
    22
    GitHub:
    KietTran0308
    I don't know how to use those 2 packs. Can you give me a code to test it out, thank you. And my entity is a zombie.
     
  4. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    PHP:
    $zumbi = .....; //Your zumbi Entity
    $to = new Vector3($zumbi->add($x$y$z));
    $pk = new MoveEntityAbsolutePacket();
    $pk->entityRuntimeId $zumbi->getId();
    $pk->position $to;
    $pk->xRot $zumbi->getYaw();
    $pk->yRot $zumbi->getYaw();
    $pk->zRot $zumbi->getPitch();
    foreach(
    $zumbi->getLevel()->getPlayers() as $p){
    $p->dataPacket($pk);
    }
     
  5. WoolChannel3295

    WoolChannel3295 Silverfish

    Messages:
    22
    GitHub:
    KietTran0308
    Errol :((
    class "pocketmine\network\protocol\MoveEntityAbsolutePacket" not found
     
  6. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    Turn
    PHP:
    MoveEntityAbsolutePacket()
    To
    PHP:
    MoveActorAbsolutePacket()
     
  7. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    Sorry, MoveActorAbsolutePacket();
     
  8. WoolChannel3295

    WoolChannel3295 Silverfish

    Messages:
    22
    GitHub:
    KietTran0308
    But why is there no move actor abs in the network \ protocol path ...
     
  9. driver1848

    driver1848 Spider Jockey

    Messages:
    35
    GitHub:
    driver1848
    Can I use this also for e. g. a cow?
     
  10. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
  11. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Yes, should work
     
  12. driver1848

    driver1848 Spider Jockey

    Messages:
    35
    GitHub:
    driver1848
    Ok nice than i try this
     
  13. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
  14. WoolChannel3295

    WoolChannel3295 Silverfish

    Messages:
    22
    GitHub:
    KietTran0308
  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.