SnowBall Potion Effects

Discussion in 'Plugin Development' started by FactionsCrazy, Aug 19, 2019.

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

    FactionsCrazy

    So I Have a idea If Someone Gets hit by a snowball they get a potion effect But I couldn't seem to figure it out
    I started with EntityDamageByEntityEvent But got no where from their (Im new to deving and don't understand much)
     
  2. Offline

    Twisted_Panda

    EntityDamageByEntityEvent
    EntityDamageEvent.DamageCause.PROJECTILE
     
  3. Offline

    FactionsCrazy

  4. Offline

    Twisted_Panda

    @EventHandler
    public void onHit(EntityDamageByEntityEvent e) {
    if(the cause EntityDamageEvent.DamageCause.PROJECTILE) {
    // your code
     
  5. Offline

    FactionsCrazy

    ok so

    @EventHandler
    public void onHit(EntityDamageByEntityEvent e) {
    if(the cause EntityDamageEvent.DamageCause.PROJECTILE) {
    then add the potion effect here

    would this all be in the main???

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 19, 2019
  6. Offline

    Twisted_Panda

    Yeah that would be it, just make it work for scenario add your checks in and everything
     
Thread Status:
Not open for further replies.

Share This Page