Issue with my Plugin.

Discussion in 'Plugin Development' started by Joshasarus, Oct 7, 2015.

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


    Hello, I'm new to Programming, I've been trying to code for around 2 days now, I've got the basics and I know quite a bit of stuff But I can't seem to figure this one out, I'll leave a link to the Code and a Picture of the Ingame issue, Btw, It works getting onto the server, But doesn't do what I need it to do :) So please help


    The issue is in the "PlayerDeathEvent" so ignore all the other code.
    Little note: I wanted the code to show the "Killer" and "Victim" some writing I wanted to killer to receive the message (You have killed "Victim") and then the Victim receive (You have been killed by "Killer" who had (Then
    the killers health)

    Issue: In a way it does what I want, But the issue is it only sends messages to the victim and tells them this (You have been killed by "Victim" who had "Their health") So it shows the Victim the Victims health and name on death and does nothing and sends nothing to the "Killer"

    Anyone know the issue?
  2. Offline


    Soooo :D
    First of all, if you're using Eclipse, do the little magical trick, Ctrl+Shift+F :p

    Then, see your if condition, you're closing it and running other code outsite it, so take ending brace after your sendMessage() method :)

    And finally, the message is not appearing for the killer, because you have to make sendMessage() separately for him :)


    PS: anyway, getHealth is not a function, use getHealth() instead ;) and for the future, don't use braces like you want:
    Last edited: Oct 7, 2015
    boomboompower and Gonmarte like this.
  3. Offline


    Sorry for very late reply I didn't get a notification but Thanks for the help, I've actually advanced a little more now and planning on releasing a plugin to bukkit soon, But cheers for the help pal!
  4. Offline


    @Joshasarus Dont forget if u add Items to a player update their Inventory ^^
  5. Offline


    this is an old post, I'm much better now :)!
  6. Offline


    Put the Solved tag then
Thread Status:
Not open for further replies.

Share This Page