本文整理汇总了PHP中pocketmine\entity\Animal::initEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP Animal::initEntity方法的具体用法?PHP Animal::initEntity怎么用?PHP Animal::initEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\entity\Animal
的用法示例。
在下文中一共展示了Animal::initEntity方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initEntity
public function initEntity()
{
//^ changed from protected->public for 1.5
parent::initEntity();
if (isset($this->namedtag->Owner)) {
$this->owner = $this->namedtag["Owner"];
} else {
$this->owner = "";
}
$x = floor($this->namedtag->Pos[0]);
$y = floor($this->namedtag->Pos[1]);
$z = floor($this->namedtag->Pos[2]);
$mgr = $this->server->getPluginManager()->getPlugin("Mobsters");
if ($mgr) {
list($owner, $id) = $mgr->getSpawner($x, $y, $z);
if ($owner && $id == self::NETWORK_ID) {
$this->owner = $owner;
$this->namedtag->Owner = new String("Owner", $this->owner);
}
}
if ($this->owner) {
echo "Perrito de " . $this->owner . "\n";
}
//##DEBUG
}
示例2: initEntity
public function initEntity()
{
$this->setMaxHealth(6);
parent::initEntity();
/*for($i = 1; $i < 40; $i++){
$this->setDataProperty($i, self::DATA_TYPE_BYTE, 1);
}*/
}
示例3: initEntity
public function initEntity()
{
$this->setMaxHealth(3);
parent::initEntity();
if (!isset($this->namedtag->Type)) {
$this->setType(mt_rand(0, 5));
}
}
示例4: initEntity
public function initEntity()
{
$this->setMaxHealth(8);
parent::initEntity();
if (!isset($this->namedtag->Color) || $this->getVariant() > 15) {
$this->setVariant(mt_rand(0, 15));
}
$this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
}
示例5: initEntity
public function initEntity()
{
$this->setMaxHealth(20);
parent::initEntity();
if (!isset($this->namedtag->Profession) || $this->getVariant() > 4) {
$this->setVariant(mt_rand(0, 4));
}
$this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
}
示例6: initEntity
public function initEntity()
{
$this->setMaxHealth(10);
parent::initEntity();
//0 burning
//1 air time
//5 invis
//14 age (0=baby 130000 = parent)
//15 no movement
//16 sheep color
//18 type/variant
//19 creeper charged
//21 love
if (!isset($this->namedtag->Type) || $this->getVariant() > 3) {
$this->setVariant(self::TYPE_NORMAL);
}
$this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
}
示例7: initEntity
public function initEntity()
{
$this->setMaxHealth(10);
parent::initEntity();
}
示例8: initEntity
public function initEntity()
{
$this->setMaxHealth(8);
//Untamed
parent::initEntity();
}
示例9: initEntity
public function initEntity()
{
parent::initEntity();
$this->setMaxHealth(2);
$this->setHealth(2);
}