Summon explosion after leap

Discussion in 'Plugin Development' started by CraterHater, Jul 23, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    CraterHater

    I want to summon an creeper with 0 fuse time that explodes immediately when the player lands after the leap, how do I do that, this is the leap code:
    Code:
     Vector dir = p.getLocation().getDirection().multiply(6);
                                                Vector vec = new Vector(dir.getX(), 1, dir.getZ());
                                                p.setVelocity(vec);
     
  2. Creeper creeper = world.spawnEntity(location, Creeper.class);
    creeper.setPowered(true);
     
  3. Offline

    SuperSniper

    Just use .getWorld().createExplosion(params);
     
  4. Offline

    CraterHater

    @FisheyLP @SuperSniper yes I know that but I want the explosion to go on the location the player lands at
     
  5. @CraterHater
    Maybe when a player leaps, add them to a list and set their fall distance up a bit so you can ensure it works, then listen for an EntityDamageEvent, check if the list contains the player and if the cause is FALL, then cancel the damage event and create an explosion.
     
Thread Status:
Not open for further replies.

Share This Page