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

Help me add geometry skin in the code NPC

Discussion in 'Development' started by Loosty, May 22, 2020.

  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:
    955
    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:
    598
    GitHub:
    GamakCZ
    which error?
     
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    what erott
     
  6. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    Can you paste the error right here?
     
  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.