Apply Custom Animation to an Entity

Discussion in 'Development' started by David Flash, Dec 15, 2020.

  1. David Flash

    David Flash Spider Jockey

    Messages:
    26
    GitHub:
    davidflashcz
    I have custom animation in my server resource pack. I know that I have to use AnimateEntityPacket, but again, I don't know how.

    My Attempt:
    PHP:
    foreach($this->main->getServer()->getLevelByName("AdventureSurvival-Quest-AlongTimeAgo")->getEntities() as $entity){
                   if(
    $entity->getNameTag() === "ยง9Nightlight"){
                     
    $pk = new AnimateEntityPacket;
                     
    $pk->create("animation.npc.wave_nosound"$pk->getNextState(), $pk->getStopExpression(), $pk->getController(), $pk->getBlendOutTime(), [$entity->getId()]);
                     
    $this->main->getServer()->broadcastPacket($pk);
                   }
                 }
     
  2. Nathanael798

    Nathanael798 Creeper

    Messages:
    1
    y si pones la ruta?
     

Share This Page

  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.