hi guys, my block is not put, why? public function onProjectileHit(ProjectileHitEvent $event) { $snowball = $event->getEntity(); $x = (int)round($snowball->getX()); $y = (int)round($snowball->getY()); $z = (int)round($snowball->getZ()); if($snowball instanceof Snowball){ $this->getServer()->getDefaultLevel()->setBlock(new Vector3($x, $y+1, $z),new Block(171,14)); } }
because PMMP also have a class called Snowball it's recommended you call it something else like CustomSnowball for example
pls, help me public function onProjectileHit(ProjectileHitEvent $event) { $snows = $event->getEntity(); if($snows instanceof CustomSnowball){ $this->getServer()->getDefaultLevel()->setBlock(new Vector3($snows->getPosition()),new Block(171,14)); } }
I'm very dull and do not understand how to make it so that the unit is delivered, I tried many things, still not at all!