createEntity($player->getWorld(), $blockReplace->getPos()->add(0.5, 0, 0.5), lcg_value() * 360, 0); if($this->hasCustomName()){ $entity->setNameTag($this->getCustomName()); } $this->pop(); $entity->spawnToAll(); //TODO: what if the entity was marked for deletion? return ItemUseResult::SUCCESS(); } }