Bukkit Explosion Power too Sensitive

Discussion in 'Plugin Development' started by krazytraynz, Aug 4, 2013.

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

    krazytraynz

    I'm trying to find a match for the explosion power when Creepers explode, but it seems like the explosion power is overly sensitive. If the power is set to 1, the explosion is too small, but if I set it to 2 it launches a Player to the point where it sets off the "Moved too Quickly" error (help with disabling it would be great as well). This could be because I'm trying to create the explosion within EntityExplodeEvent, but I thought setCancelled(true) would stop the explosion. Or does it just stop block damage?
     
  2. Offline

    chasechocolate

    Were you in creative mode? I had this same problem, and I fixed it by going in survival.
     
  3. Offline

    krazytraynz

    chasechocolate
    No, Survival mode is the only way I can get the Creepers to explode.
     
  4. Offline

    krazytraynz

  5. Can I see the code?
     
  6. Offline

    krazytraynz

    HeyAwesomePeople
    Code:java
    1. if (random.nextInt(1) == 0) { //aC == 1
    2. boolean a = cp.getConfig().getBoolean("Creeper.Arrow.Enabled");
    3. if ((a == false) || (e.isCancelled()) || (e.getEntity() == null)) {
    4. return;
    5. }else{
    6. if ((e.getEntity() instanceof Creeper)) {
    7. double power = cp.getConfig().getInt("Creeper.Arrow.Explosion.Power");
    8. float explosionPower = (float)power;
    9. for (Block block : e.blockList()) {
    10. Location loc = block.getLocation();
    11. Location loc1 = loc.add(new Location(loc.getWorld(), 1, 0, 1));
    12. block.getLocation().getWorld().spawnArrow(loc, new Vector(0, 2, 0), 1.0F, 3.0F);
    13. block.getLocation().getWorld().spawnArrow(loc1, new Vector(0, 2, 0), 1.0F, 2.85F);
    14. e.setCancelled(true);
    15. e.getLocation().getWorld().createExplosion(e.getLocation(), explosionPower);
    16. if (!cp.getConfig().getBoolean("Creeper.Arrow.Explosion.BlockDamage")) {
    17. block.setType(block.getType());
    18. }
    19. }
    20. }
    21. }
    22. }
     
  7. Offline

    unforgiven5232

    krazytraynz Ever thought of removing the dmg then add your own? So you can take the damage from the creeper and then divide by 2 or however you want
     
  8. Offline

    krazytraynz

    I'm not trying to change the damage, I want to change the size of the explosion.
     
  9. Offline

    unforgiven5232

    krazytraynz Bump :) I don't know how to do this then.
     
  10. Offline

    krazytraynz

Thread Status:
Not open for further replies.

Share This Page