Hi I would like to know how to get the meta when player hold a item for example 351:2 here: PHP: if($player->getItemInHand()->getId() == "351"){ $level->addParticle(new FlameParticle(new Vector3($posX, $posY+1, $posZ))); $level->addParticle(new HappyVillagerParticle(new Vector3($posX+0.5, $posY+1, $posZ))); $level->addParticle(new HappyVillagerParticle(new Vector3($posX, $posY+1, $posZ+0.5))); }
I meant here xD PHP: public function AddParticle(){ foreach($this->getServer()->getOnlinePlayers() as $player){ $posX = $player->x; $posY = $player->y; $posZ = $player->z; $level = $player->getLevel(); //$lapis = Item::get(351, 4, 1); if($player->getItemInHand()->getId() == "351"){ $level->addParticle(new FlameParticle(new Vector3($posX, $posY+1, $posZ))); $level->addParticle(new HappyVillagerParticle(new Vector3($posX+0.5, $posY+1, $posZ))); $level->addParticle(new HappyVillagerParticle(new Vector3($posX, $posY+1, $posZ+0.5))); } } }
PHP: $handItem = $player->getItemInHand();if($handItem->getId() === 351 && $handItem->getDamage() === 2) {