Method Entity#damage(Integer) doesn't call EntityDamageEvent

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • None
    • Affects Version/s: None
    • Environment:

      Windows 10, latest build, IntelliJ enviorment

      I have this listener
      [code]
      @EventHandler(priority = EventPriority.HIGHEST)
      public void damage(EntityDamageEvent e) {
      nServer.log(Level.DEBUG, "IS PLAYER: " + (e.getEntity() instanceof Player));
      if (e.getEntity() instanceof Player)

      { Player p = (Player) e.getEntity(); nServer.log(Level.DEBUG, "WONT KILL: " + (p.getHealth() - e.getDamage() > 0)); }

      }
      [/code]
      And when I do Player#Damage(1000), the event doesn't fire...
      A bug? Anyway I can bypass this?

      Console:
      [code]
      //Fall damage
      [23:11:14 INFO]: [nAPI] [DEBUG] IS PLAYER: true
      [23:11:14 INFO]: [nAPI] [DEBUG] WILL KILL: false
      //Kill command
      [23:11:20 INFO]: DeprecatedLuke issued command /pluginkilltest
      //EVENT NOT FIRED
      [23:11:20 INFO]: DeprecatedLuke died
      [/code]

          [SPIGOT-1515] Method Entity#damage(Integer) doesn't call EntityDamageEvent

          Luke Kander added a comment - - edited

          My teammate did more research and indeed it doesn't fire the event

          //player.damage(Double.parseDouble(args[1]));
          [15:47:40 INFO]: x0Dan0x issued server command: /damage a 1
          [15:47:40 INFO]: x0Dan0x issued server command: /damage a 1
          [15:47:41 INFO]: x0Dan0x issued server command: /damage a 1
          [15:47:42 INFO]: x0Dan0x issued server command: /damage a 1
          [15:47:46 INFO]: x0Dan0x issued server command: /gamemode c
          [15:47:50 INFO]: x0Dan0x issued server command: /gamemode s
          //FALL DAMAGE
          [15:48:00 INFO]: [nAPI] [DEBUG] IS PLAYER: true
          [15:48:00 INFO]: [nAPI] [DEBUG] WONT KILL: true
          //CHANGED TO Entity#damage(Double, Entity) and the even fires if it has an entity:
          [15:50:09 INFO]: x0Dan0x issued server command: /damage a 1
          //player.damage(Double.parseDouble(args[1]), player);
          [15:50:09 INFO]: [nAPI] [DEBUG] IS PLAYER: true
          [15:50:09 INFO]: [nAPI] [DEBUG] WONT KILL: true
          

          Luke Kander added a comment - - edited My teammate did more research and indeed it doesn't fire the event //player.damage( Double .parseDouble(args[1])); [15:47:40 INFO]: x0Dan0x issued server command: /damage a 1 [15:47:40 INFO]: x0Dan0x issued server command: /damage a 1 [15:47:41 INFO]: x0Dan0x issued server command: /damage a 1 [15:47:42 INFO]: x0Dan0x issued server command: /damage a 1 [15:47:46 INFO]: x0Dan0x issued server command: /gamemode c [15:47:50 INFO]: x0Dan0x issued server command: /gamemode s //FALL DAMAGE [15:48:00 INFO]: [nAPI] [DEBUG] IS PLAYER: true [15:48:00 INFO]: [nAPI] [DEBUG] WONT KILL: true //CHANGED TO Entity#damage( Double , Entity) and the even fires if it has an entity: [15:50:09 INFO]: x0Dan0x issued server command: /damage a 1 //player.damage( Double .parseDouble(args[1]), player); [15:50:09 INFO]: [nAPI] [DEBUG] IS PLAYER: true [15:50:09 INFO]: [nAPI] [DEBUG] WONT KILL: true

            Assignee:
            Unassigned
            Reporter:
            Luke Kander
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: