Solved How does badlion do combo mode? (Hit delay)

Discussion in 'Spigot Plugin Development' started by gluebaby, Apr 15, 2017.

  1. As the title suggests, how do badlion and other practice servers create the combo game mode (essentially where there is very little hit delay so you can hit a lot faster)?

    I guess a similar question would be how can I modify the hit delay via plugin? The server is 1.8 so I don't want to revert combat mechanics from 1.9, just lower the hit delay.

    Thanks for your help!
     
  2. Code (Text):
      @EventHandler
      public void onJoin(PlayerJoinEvent event)
      {
        event.getPlayer().setMaximumNoDamageTicks(Hit delay in ticks);
      }
     
  3. latiku

    Supporter

    It's stupid to do it in a join event
     
  4. Wow didn't know that existed. Thanks!

    Then what's a better way?
     
  5. Damage Events I believe are the best ways to go with this.
     
  6. For combo yes, but for setting a general hit delay join should work.
     
  7. I put it in a join event as an example.
     
  8. You should go find the async damage thread, shows you code to replace Minecrafts hit detection and its async.
     
  9. The player has a setNoDamageTick or something and there is a generic attribute. I did a similar hint when I had the same idea as you and I what I did was checked for an entitydamageevent -> player -> set damage cooldown time to 0

    However, the issue I found with this is that the knockback builds up and becomes insane which is why servers usually use custom kb patches.

    Edit: player.setNoDamageTicks
     
  10. Well, in combo mode on PvP servers the knockback does get insane if you are getting comboed. Eventually the player will get hit so much that the attacker can't hit them though.