Help me add geometry skin in the code NPC

Discussion in 'Development' started by Loosty, May 22, 2020 at 5:53 PM.

  1. Loosty

    Loosty Spider

    Messages:
    14
    GitHub:
    Loosty
    public function CreateComingSoon(Player $player){
    $nbt = new CompoundTag();
    $x = "-106.5687";
    $y = "46";
    $z = "15.5543";
    $nbt->setTag(new ListTag("Pos", [
    new DoubleTag("", $x),
    new DoubleTag("", $y),
    new DoubleTag("", $z)
    ]));
    $nbt->setTag(new ListTag("Motion", [
    new DoubleTag("", 0),
    new DoubleTag("", 0),
    new DoubleTag("", 0)
    ]));
    $nbt->setTag(new ListTag("Rotation", [
    new FloatTag("", $player->getYaw()),
    new FloatTag("", $player->getPitch())
    ]));
    $nbt->setTag(new CompoundTag("Skin", [
    "Data" => new StringTag("Data", $player->getSkin()->getSkinData()),
    "Name" => new StringTag("Name", $player->getSkin()->getSkinId())
    ]));

    $human = new ComingSoon($player->getLevel(), $nbt);
    $human->setHealth(20);
    $human->setMaxHealth(20);
    $human->setNameTag("test!");
    $human->getInventory()->setItem(0, Item::get(159, 11, 1));
    $human->getInventory()->setHeldItemIndex(0);
    $human->setNameTagAlwaysVisible(true);
    $human->spawnTo($player);
    $player->getLevel()->addEntity($human);
    }
     
  2. Levi

    Levi Skeleton

    Messages:
    874
    GitHub:
    captainleviftw
  3. Loosty

    Loosty Spider

    Messages:
    14
    GitHub:
    Loosty
    when I try to create the NPC with geometric skin it ends up giving error.

    could you help me solve this problem
     
  4. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    495
    GitHub:
    GamakCZ
  5. Levi

    Levi Skeleton

    Messages:
    874
    GitHub:
    captainleviftw
  6. NTT

    NTT Zombie

    Messages:
    201
    GitHub:
    NTT1906
    Can you paste the error right here?
     

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.