Solved how to check if player gets combo hits

Discussion in 'Plugin Development' started by CakeProgrammer, Sep 24, 2013.

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

    CakeProgrammer

    ^^
    I wanna check if player get combo hits (5 combo hits without get 1 hit) on someone
    it's will do something
    thanks for the guys decide to help ;)
     
  2. Offline

    metalhedd

    You haven't asked a question, you've described a feature. nobody's going to write the code for you.
     
  3. Offline

    CakeProgrammer

    read the title : "how to"
    the question this how to do it =/(facepalm)
     
  4. Offline

    HyrulesLegend

  5. Offline

    metalhedd


    Facepalm at yourself bud. You're doing this wrong. you're supposed to come here with a question about the bukkit api, not a 'how to do I program' question. The answer to the question as you've phrased it is: "By programming it to do that." The rest is up to you as the programmer. come back when you have a specific question about the bukkit api.
     
    blablubbabc likes this.
  6. Offline

    CakeProgrammer

    I asking how to make this combo hits on bukkit api o-o
    if you not wanna help just go out =/
     
  7. Offline

    GummyBearKing

    What I would recommend doing: Use a hashmap to store a <Player,Integer> player being the player, the integer being the hits. Then use a EntityDamageByEntity Event to register the pvp attacks. Finally, on hit, if a player is in the hashmap, increase the Integer by one. Then in your code, check if he is over 5 in the integer section (>=). Otherwise, if he is not in the hashmap, put him in with a value of one.
     
  8. Offline

    metalhedd

    the problem is you havent thought about the problem long enough to even break it down one tiny level... you don't need to know how to 'make combo hits' you need to know how to detect when a player hits something. if you can do that, then detecting combos is as easy as tracking a number in a variable. so your question should be: "How do I detect when one player hits another?" and the answer is: "EntityDamageByEntityEvent".
     
  9. Offline

    GummyBearKing

    To be fair, I mentioned EntityDamageByEntityEvent in my reply.
     
  10. Offline

    metalhedd

    GummyBearKing I never meant to imply that you didn't. I didn't even see your post until after I submitted mine. It doesn't change the fact that the OP is just loosely describing a feature and hasn't made any effort, whatsoever to research it before coming here asking for a solution to a problem he can't even completely define yet.
     
  11. Offline

    GummyBearKing

    Yeah, I agree, but who knows. I did however give him an answer that was not code, so he does still have to work much of it out on his own.
     
Thread Status:
Not open for further replies.

Share This Page