Looking for the right event to use...

Discussion in 'Plugin Development' started by MCJoshua345, Mar 18, 2015.

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

    MCJoshua345

    Okay, so I have a lobby plugin, and I'm making a pop class for it. I can do the pop stuff, but I just need to know the right event and how to make the variables for the player who popped the person and the "victim". The problem is, I have PvP disabled, so I don't think any EntityDamage or playerHitPlayer events would work. Thanks for the help, and Keep Blocking!
    - xXInfinityXx (formerly MCJoshua345)
     
  2. PlayerInteractEntityEvent
     
  3. Offline

    MCJoshua345

    @FisheyLP
    Thank you, but can I have some more info on how this works? I also need how to make those variables about what the Player Interacted with.
     
  4. @MCJoshua345
    Player whoClicked = e.getPlayer();
    Entity clickedEntity = e.getRightClicked();
     
  5. Offline

    MCJoshua345

    @FisheyLP
    Hmmm. I was kinda looking for if they left-clicked, but this will do. Thanks!
     
  6. You could use the EntityDamageByEntityEvent
    and use @EventHandler(ignoreCancelled=true) it will still be executed if the event is cancelled
     
  7. Offline

    Zombie_Striker

    @MCJoshua345
    If you wanted to get if the player LeftClicked, then use EntityDammagedByEntityEvent.
     
  8. There is no event called EntityDammagedByEntityEvent. Btw: I were faster than you :p
     
    Last edited: Mar 18, 2015
  9. Offline

    Zombie_Striker

    @FisheyLP

    You right. Its EntityDamageByEntityEvent (just one m)
     
  10. Offline

    MCJoshua345

    @FisheyLP
    That's genius! Thank you!

    @FisheyLP
    Oh, do you know how to get the Entity that was damaged?

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Mar 18, 2015
  11. Offline

    timtower Administrator Moderator

  12. Offline

    Zombie_Striker

    event#getEntity()#getType()
     
  13. Offline

    MCJoshua345

    @FisheyLP
    Nevermind, got it! Thanks for all the help!
     
  14. Please mark thread as solved
     
Thread Status:
Not open for further replies.

Share This Page