No explosion

Discussion in 'Plugin Development' started by fls1234, Oct 15, 2013.

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

    fls1234

    I can't configure no explosion out with WitherSkull. Because it not setyeild

    Code:java
    1. @EventHandler
    2. public void onShoot(EntityShootBowEvent e)
    3. {
    4. if (e.getEntity() instanceof Player)
    5. {
    6. Player p = (Player) e.getEntity();
    7.  
    8. if(Util.WitherKit.contains(p.getName()))
    9. {
    10. e.setCancelled(true);
    11. Entity Launch =p.launchProjectile(WitherSkull.class);
    12. Launch.setVelocity(e.getProjectile().getVelocity().multiply(0.4));
    13. }
    14. }
    15. }
     
  2. Offline

    Goblom

    Entity is a base. You cannot configure explosions out because not all entitys can explode. What you can do is something like this...

    Code:java
    1. WitherSkull skull = player.getWorld().spawn(event.getProjectile().getLocation().add(0, 1, 0), WitherSkull.class);
    2. skull.setIsIncendiary(false);
    3. skull.setVelocity(event.getProjectile().getVelocity().multiply(0.4));
    4.  
    5. event.setProjectile(skull);
     
  3. Offline

    hubeb

    entity explode event;
    check of entity is wither ;
    if it is setCancelled(true);
     
Thread Status:
Not open for further replies.

Share This Page