1.8.8 how to create Assists

Discussion in 'Spigot Plugin Development' started by toshi2131, Apr 24, 2020.

  1. hello, so I have a Minecraft server with a game.
    so the game has an economy, kills, shop custom stuff.
    the plugin isn't mine so I cant edit the code or change anything beside little config stuff.

    I thought of adding assists in a other plugin that I codded some stuff there for my server.
    the thing is I don't know how to code a working assists system, what to use etc.

    so my question is what do I need to useto code an assists system?
  2. What do you mean by "assists"?
  3. drives_a_ford


    Most likely someone who 'assisted' in killing someone. I.e dealt damage to them before the one who killed them

    You would have to keep track of who's damaged who (probably listening to EntityDamageByEntityEvent). And once someone dies, get the other people who've damaged the player who dies and figure out which (if any) should get the 'assist' depending on the amount of damage they did or how long ago they did the damage or whatever you like.

    With that said, I hope you're only focusing on player attacking player (and you'd need to check for that) because otherwise your collections may very well become huge.
  4. ok, ill try go learning that event, ty!