Help me... when I try add particles there is no console error so what is wrong here? PHP: <?phpnamespace Particle\effects;use pocketmine\level\particle\RedstoneParticle;/** * The redstone particle effect */class RedstoneParticleEffect implements ParticleEffect { /** * Run the particle effect * * @param integer $currentTick The current tick * @param Player $player The player to fix the effect for * @param array $showTo The players to show the particle to * @return null */ public function tick($currentTick, $player, $showTo) { if ($player->lastUpdate < $currentTick - 5) { $v = 2 * M_PI / 120 * ($n % 120); $i = 2 * M_PI / 70 * ($n % 70); $x = cos($i); $y = cos($v); $z = sin($i); $player->getLevel()->addParticle(new RedstoneParticle($player->add($x, 1 - $y, -$z)), $showTo); $player->getLevel()->addParticle(new RedstoneParticle($player->add(-$x, 1 - $y, $z)), $showTo); } else { $distance = -0.5 + lcg_value(); $yaw = $player->yaw * M_PI / 180; $x = $distance * cos($yaw); $z = $distance * sin($yaw); $y = lcg_value() * 0.4; $player->getLevel()->addParticle(new RedstoneParticle($player->add($x, $y, $z)), $showTo); } }}
Or, when I configure someone to have that specific particles in config.yml they only get Portal ones, which is the ones that work... the lava, redstone + rainbow don't work for some reason?
Some of them might not work, because they may not entirely implemented yet (although I'm not 100% sure). For instance, Redstone isn't implemented in PocketMine yet. Also, there is no "Rainbow" particle.
All particles which can currently be used can be found here: https://github.com/pmmp/PocketMine-MP/tree/master/src/pocketmine/level/particle
@Sandertv are they all implemented? Because redstoneparticle.php is there... and thats what my issue is about lol
The Cannot give particles to <player>, could I see your code that outputs that? I can only assume your code does that, as I've never seen that error before.
PHP: * Give a user particles * * @param string $user The username of the person to give particles * @param string $particle The particle effect to give (The class name) * @return boolean Whether or not giving the particles was successful */ public function giveParticle($user = '', $particle = '') { if(($player = $this->getServer()->getPlayerExact($user)) instanceof Player) { if(!isset($this->particles[$player->getDisplayName()])) { $name = $this->getParticleClass($particle); $this->particles[$player->getDisplayName()] = $this->manager->setPlayerParticleEffect($player, $this->manager::$$name); $this->players[$player->getDisplayName()] = get_class($this->particles[$player->getDisplayName()]); return true; } } return false; } @Sandertv
This code works... it doesn't put dust on the player, but it puts the portal particle; PHP: <?phpnamespace Particle\effects;use pocketmine\level\particle\DustParticle;use pocketmine\level\particle\PortalParticle;/** * The effect for the portal */class PortalParticleEffect implements ParticleEffect { /** * Run the particle effect * * @param integer $currentTick The current tick * @param Player $player The player to fix the effect for * @param array $showTo The players to show the particle to * @return null */ public function tick($currentTick, $player, $showTo) { $player->getLevel()->addParticle(new DustParticle($player->add(-0.5 + lcg_value(), 1.5 + lcg_value() / 2, -0.5 + lcg_value()), 255, 0, 255), $showTo); $player->getLevel()->addParticle(new PortalParticle($player->add(-0.5 + lcg_value(), 0.5 + lcg_value(), -0.5 + lcg_value())), $showTo); }}