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

How to put sword on Drowned hand?

Discussion in 'Development' started by Joao Nunes, May 3, 2020.

  1. Joao Nunes

    Joao Nunes Spider Jockey

    Messages:
    30
    GitHub:
    joaonunes12
    I'm trying to put the sword in a drowned's hand, but getInventory() is not usable for this type of entity.
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    What code did you use to spawn it?
     
  3. Joao Nunes

    Joao Nunes Spider Jockey

    Messages:
    30
    GitHub:
    joaonunes12
    PHP:
            $nbt Entity::createBaseNBT($block->add(111), nulllcg_value() * 3600);

     
    $entity = new Slaughter($player->level$nbt);
     
     
    $entity->spawnToAll();
     
    $entity->getInventory()->setItemInHand(Item::get(276));
    Console report getInventory don't exists to entity
     
  4. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    I will help you latter :3
     
  5. Joao Nunes

    Joao Nunes Spider Jockey

    Messages:
    30
    GitHub:
    joaonunes12
    I create a slapper human with drowned custom skin ksksks, the only way I found
     
  6. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    What api are you using for that entity class?
     
  7. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Entities don't have inventories natively so you can add it by using the one of the Actor packets
     
    Joao Nunes and GamakCZ like 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.