Kill/Death Logger

Discussion in 'Plugin Development' started by DW3Predator, Dec 10, 2014.

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

    DW3Predator

  2. Offline

    Skionz

    @DW3Predator Don't name variables with the first letter uppercase; it confuses everyone.
    Provide more information on your issue. "This is not working correctly for me" tells us nothing. Are you getting a stack-trace? Is it a logic error? Have you debugged? If not debug.
     
  3. Offline

    ColonelHedgehog

    A couple things.

    - Yeah, we'll be able to help 100% more if we have a stack trace. And some details.
    - You're casting the killed and killer variables before you check if they're players. This will throw a class cast exception in the event either assumption is false. You need to make sure that the killer isn't null.
    - You aren't saving your config. Use the saveConfig() method after you set the values or it won't keep the values.
     
    Last edited: Dec 11, 2014
  4. PlayerDeathEvent's entity always is a Player, no need for a cast. player.getKiller() is always a Player unless they died not by a Player, where it would be null, so he just needs to check if it is not null.
     
  5. Offline

    ColonelHedgehog

    Oh, whoops! Thanks for catching that. <Insert excuses relating to the lateness of the time>

    I'll edit my post.
     
    SuperOriginal and KingFaris11 like this.
Thread Status:
Not open for further replies.

Share This Page