Solved Cancel arrow flame

Discussion in 'Spigot Plugin Development' started by kottalizer, Jun 5, 2016.

  1. kottalizer

    Supporter

    If a player is hit by an arrow shot by a bow with the flame enchantment, the player is set on fire. How can I disable this behaviour?
     
  2. Dont enchant your bow with flame :3
     
  3. kottalizer

    Supporter

    Please refrain from being useless.
     
  4. Its a solutiuon to your issue,
     
    • Optimistic Optimistic x 1
  5. kottalizer

    Supporter

    It is certainly not a solution.
     
    • Agree Agree x 1
  6. You asked, how to not set people on fire with a flame bow when shot, the trick it, dont put fllame on the bow, a solution.
     
  7. kottalizer

    Supporter

    Considering the topic was filed under `Spigot Plugin Development' your suggestion is not an adequate solution to the problem.
     
    • Agree Agree x 1
  8. _Ug

    _Ug

    Assuming you don't want to just turn off the fire on the arrow after it is shot then (not knowing if it will work) this is what I suggest you do:
    Code (Text):

    public void onDamage(EntityDamageByEntityEvent event){
    if(!(event.getDamager() instanceof Arrow) || !(event.getEntity() instanceof Player))
    return;
    Arrow arrow = (Arrow) event.getEntity();
    if(arrow.getFireTicks() >= 1)
    arrow.setFireTicks(0);
    }
     
    Now, if that does work you will have a problem being that the arrow on fire from anything (including flying through lava) will not set the target on fire.
     
  9. kottalizer

    Supporter

    Thank you. Unfortunately that didn't solve the issue. The player is still set on fire when the arrow hits them.
     
  10. I believe arrows igniting players fire an EntityCombustByEntityEvent.
     
    • Informative Informative x 1
  11. You most certainly are not being helpful whatsoever and knew this obviously wasn't what the user was requiring.


    If I'm not mistaken, you could take a look at
    https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityCombustByEntityEvent.html

    It returns a combuster, and combustee.
    #getCombuster
     
    • Informative Informative x 1
  12. kottalizer

    Supporter