Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Human nps

Comments in 'Plugin Development' started by Cristalix, Jul 22, 2016.

  1. Cristalix
    Offline

    Cristalix New Member

    Joined:
    Sep 10, 2015
    Posts:
    38
    Minecraft User:
    Gistrec
    Hi, I would like to create TOP-list on my server.
    But text is very simply. And I think about nps-top:
    Human nps have a skin a top player and player's name.
    And when anyone tap on nps, we send him best score and info about top-player
    How can I create nps, how can I change skin? ;)
    PHP:
    $npc = new Human($player->chunk,
    new 
    CompoundTag("", [
    "Pos" => new ListTag("Pos", [
    new 
    DoubleTag(""$block->getX() + 0.5),
    new 
    DoubleTag(""$block->getY()),
    new 
    DoubleTag(""$block->getZ() + 0.5)
    ]),
    "Motion" => new ListTag("Motion", [
    new 
    DoubleTag(""0),
    new 
    DoubleTag(""0),
    new 
    DoubleTag(""0)
    ]),
    "Rotation" => new ListTag("Rotation", [
    new 
    FloatTag(""$player->getYaw()),
    new 
    FloatTag(""$player->getPitch())
    ]),
    "Skin" => new CompoundTag("Skin", [
    "Data" => new StringTag("Data"$player->getSkinData())
    ])
    ]
    ));
    $npc->spawnToAll();
    $npc->setDataProperty(Entity::DATA_NAMETAGEntity::DATA_TYPE_STRING$player->getName());
    $npc->setDataProperty(Entity::DATA_SHOW_NAMETAGEntity::DATA_TYPE_BYTE1);
    HyperCry likes this.
  2. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    $npc->setSkin($skin, $skinname);

Share This Page

Advertisement