EntityDamagedEvent Question: Getting Player value

Discussion in 'Bukkit Discussion' started by The_Guest, Jan 15, 2011.

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

    The_Guest

    I've been trying to get an answer/solution for this since last night when trying to convert Hey0 code.

    How do you get a Player value from EntityDamagedEvent?

    The basic start of the OnEntityDamaged Method:


    Code:
    public void OnEntityDamaged(EntityDamagedEvent event)
            {
    //Code that does stuff.
               }
    


    And I'm going to need something like:


    Code:
    public void OnEntityDamaged(EntityDamagedEvent event)
            {
    Player defender = event.getEntity().getPlayer();
                 If (defender.getAirTicks >= 0)
                      {
          //Code that does stuff.
                       }
            }
              
    In the current build, is there a way to do this at all? Or will there be?

    Also are AirTicks in/going to be in soon? :)

    Thanks, The_Guest.
     
  2. Offline

    axel3200

    nevermind.
     
Thread Status:
Not open for further replies.

Share This Page