The Explosion dosnt wrk: PHP: <?phpnamespace gr;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\entity\ProjectileHitEvent;use pocketmine\level\Position;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\level\Explosion;use pocketmine\entity\projectile\Egg;class Grenade extends PluginBase implements Listener { public function onEnable(){ $this->getLogger()->info("Plugin Enabled"); $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onGrenadeThrow(ProjectileHitEvent $ev){ if($ev->getEntity() instanceof Egg){ $explosion = new Explosion(new Position($ev->getEntity()->getX(), $ev->getEntity()->getY(), $ev->getEntity()->getZ(), $ev->getEntity()->getLevel()), 4, null); $explosion->explodeA(); } } public function onJoin(PlayerJoinEvent $ev){ if($ev->getPlayer()->isOp()){ $ev->getPlayer()->sendMessage("§eYou are using Grenade version: 1.0"); } else { } }}?>
I know absolutely nothing about Explosions, but are you sure it passes that if? And are there any errors?
Same, I think the event is bugged or something because the explotions worked on CobaltGuns (I tested with an older pmmp version tho)
> ExplosionA is for 'Calculated blocks that will be affected by the explosion' > ExplosionB is to create the explosion from the blocks given by the explosionA (I express myself very badly sorry x)) So if you just use $explosion->explodeA () it will only give the blocks broken but will not create the explosion If you only use $explosion-> explodeB() it will create an explosion yes, but no blocks will be broken. So to create an explosion that calculates the broken blocks and removes them it is necessary to use: PHP: $explosion = new Explosion(new Position($en>getX(), $en->getY(), $en>getZ(), $en->getLevel()), 4, null);$explosion->explosionA();$explosion->explosionB(); https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/level/Explosion.php#L92#L257