Trying to create a custom sized explosion that destroys blocks, however, the following code needs modification
PlayerEvents.tick(event => {
let player = event.player;
let level = event.level;
// Check if the player is falling (motionY is negative) and the shift key is pressed
if (player.motionY < 0 && player.shiftKeyDown) {
// Calculate the explosion power as the absolute value of motionY
let explosionPower = Math.abs(player.motionY * 100);
player.tell("explode")
// Get the player's current position
let posX = player.x;
let posY = player.y - 0.5; // One block below the player
let posZ = player.z;
// Summon an explosion at the specified location
let explosion = player.level.createExplosion(posX, posY, posZ);
explosion.strength(explosionPower);
explosion.causesFire(true);
explosion.exploder(player);
explosion.explosionMode(Internal.Explosion$BlockInteraction.DESTROY)
explosion.explode();
}
});