Solved World#createExplosion doing almost no damage

Discussion in 'Plugin Development' started by fireboyev, Jan 8, 2017.

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

    fireboyev

    Hey all,
    I have it in my plugin where snowballs explode on impact, for some reason when the explosion is near (1 block away) it does almost no damage to the player yet the power is set to 5F which is more than regular tnt, but when the snowball actually hits the player on the head, it instantly kills them. Anyone know what is going on here?

    code:
    Code:
                            if (event.getHitBlock() != null)
                                loc = event.getHitBlock().getLocation();
                            else if (event.getHitEntity() != null)
                                loc = event.getHitEntity().getLocation();
                            if (loc != null)
                                loc.getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 5F, false, false);
     
  2. Offline

    Zombie_Striker

    @fireboyev
    Do you have any other plugins that may be interfering with this? Can you post the rest of the event?

    What do you mean by almost no damage? Does it do half a heart, full heart?
     
  3. Offline

    fireboyev

    I have no other plugins that would be interfering and by almost no damage I mean half a heart without armor and no damage with diamond armor

    -EDIT-
    It seems that the block was stopping most of the damage from the explosion so I got it to add 1 to the y and it started working perfectly
     
    Last edited: Jan 8, 2017
  4. Offline

    Zombie_Striker

    @fireboyev
    If your problem has been solved, mark this thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page