Events not working

Discussion in 'Plugin Development' started by mydeblob, Aug 18, 2013.

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

    mydeblob

    For some reason my onplayerdeath events are not working. I think I have done everything right. Here is my event handler class
    Show Spoiler

    Code:java
    1. package mydeblob.eternalsurvival.kitpvp;
    2.  
    3. import net.milkbowl.vault.economy.Economy;
    4. import org.bukkit.entity.Player;
    5. import org.bukkit.event.EventHandler;
    6. import org.bukkit.event.Listener;
    7. import org.bukkit.event.entity.PlayerDeathEvent;
    8.  
    9.  
    10.  
    11.  
    12. public class PlayerKillEventListener implements Listener{
    13. public static Economy econ = null;
    14. @EventHandler
    15. public void onPlayerDeath(PlayerDeathEvent event){
    16. Player victim = event.getEntity();
    17. Player killer = event.getEntity();
    18. if(event.getEntity() instanceof Player){
    19. //If loops for subtracting balance
    20. if(econ.getBalance(victim.getName()) > 25){
    21. double highdeposit = econ.getBalance(victim.getName()) % 15;
    22. econ.withdrawPlayer(victim.getName(), highdeposit);
    23. victim.sendMessage("You lost" + highdeposit + "worth of tokens for getting killed by" + killer.getKiller());
    24. }else{
    25. double lowdeposit = econ.getBalance(victim.getName()) % 5;
    26. econ.withdrawPlayer(victim.getName(), lowdeposit);
    27. victim.sendMessage("You lost" + lowdeposit + "worth of tokens for getting killed by" + killer.getKiller());
    28. }
    29. //if(else) loop if the player died from natural damage
    30. }else{
    31. if(econ.getBalance(victim.getName()) > 25){
    32. double highdeposit = econ.getBalance(victim.getName()) % 15;
    33. econ.withdrawPlayer(victim.getName(), highdeposit);
    34. victim.sendMessage("You lost" + highdeposit + "worth of tokens for dying");
    35. }else{
    36. double lowdeposit = econ.getBalance(victim.getName()) % 5;
    37. econ.withdrawPlayer(victim.getName(), lowdeposit);
    38. victim.sendMessage("You lost" + lowdeposit + "worth of tokens for dying");
    39. }
    40. }
    41. }//End of playerdeath event
    42. public void onPlayerKill(PlayerDeathEvent event) {
    43. Player killer = event.getEntity();
    44. Player p = event.getEntity();
    45. if (killer.getKiller() instanceof Player) {
    46. if(econ.getBalance(p.getName()) > 25){
    47. double highdeposit = econ.getBalance(killer.getName()) % 15;
    48. econ.depositPlayer(killer.getName(), highdeposit);
    49. killer.sendMessage("You gained" + highdeposit + "worth of tokens for killing" + p.getName());
    50. }else{
    51. double lowdeposit = econ.getBalance(killer.getName()) % 5;
    52. econ.depositPlayer(killer.getName(), lowdeposit);
    53. killer.sendMessage("You gained" + lowdeposit + "worth of tokens for killing" + p.getName());
    54. }
    55. if(econ.getBalance(p.getName()) == 0){
    56. econ.depositPlayer(killer.getName(), 2);
    57. killer.sendMessage("You gained $2 worth of tokens for killing" + p.getName());
    58. }
    59.  
    60.  
    61. }
    62. }
    63.  
    64. }
    65.  


    And here is my main. Yes I did register the event.
    Show Spoiler

    Code:java
    1.  
    2. import java.io.File;
    3. import java.util.logging.Logger;
    4. import net.milkbowl.vault.chat.Chat;
    5. import net.milkbowl.vault.economy.Economy;
    6. import org.bukkit.ChatColor;
    7. import org.bukkit.command.Command;
    8. import org.bukkit.command.CommandSender;
    9. import org.bukkit.configuration.file.FileConfiguration;
    10. import org.bukkit.configuration.file.YamlConfiguration;
    11. import org.bukkit.permissions.Permission;
    12. import org.bukkit.plugin.RegisteredServiceProvider;
    13. import org.bukkit.plugin.java.JavaPlugin;
    14.  
    15. public class KitPvpMain extends JavaPlugin{
    16. public static KitPvpMain plugin;
    17. public static Logger logger = Logger.getLogger("Minecraft");
    18. private File file;
    19. public boolean logToConsole;
    20. public static Economy econ = null;
    21. public static Chat chat = null;
    22. public static Permission perms = null;
    23. File configfile;
    24. FileConfiguration config;
    25.  
    26. //-----------------CONFIG OPTIONS----------------
    27. public static int sharpness_I_price;
    28. public static int sharpness_II_price;
    29. public static int sharpness_III_price;
    30. public static int fireaspect_I_price;
    31. public static int fireaspect_II_price;
    32. public static int knockback_I_price;
    33. public static int knockback_II_price;
    34. public static int power_I_price;
    35. public static int power_II_price;
    36. public static int power_III_price;
    37. public static int punch_I_price;
    38. public static int punch_II_price;
    39. public static int punch_III_price;
    40. public static int infinity_I_price;
    41. public static int protection_I_price;
    42. public static int protection_II_price;
    43. public static int protection_III_price;
    44. public static int fireprotection_I_price;
    45. public static int fireprotection_II_price;
    46. public static int fireprotection_III_price;
    47. public static int thorns_I_price;
    48. public static int thorns_II_price;
    49. public static int thorns_III_price;
    50. public static int projectileprojection_I_price;
    51. public static int projectileprojection_II_price;
    52. public static int projectileprojection_III_price;
    53.  
    54.  
    55. @Override
    56. public void onEnable(){
    57. getServer().getPluginManager().registerEvents(new PlayerKillEventListener(),this);
    58. if (!setupEconomy()){
    59. logger.info("----------------------------------------------------------");
    60. logger.info("Eternal Kit PVP disable due to no Vault dependency found!");
    61. logger.info("----------------------------------------------------------");
    62. return;
    63. }
    64. setupPermissions();
    65. setupChat();
    66.  
    67. //---------------------Configuration File---------------------
    68. this.configfile = new File(getDataFolder(), "config.yml");
    69. this.config = YamlConfiguration.loadConfiguration(this.configfile);
    70. saveConfig();
    71. reloadConfig();
    72. this.config = getConfig();
    73.  
    74.  
    75. sharpness_I_price = this.config.getInt("sharpness 1 price");
    76. sharpness_II_price = this.config.getInt("sharpness 2 price");
    77. sharpness_III_price = this.config.getInt("sharpness 3 price");
    78. fireaspect_I_price = this.config.getInt("fireaspect 1 price");
    79. fireaspect_II_price = this.config.getInt("fireaspect 2 price");
    80. knockback_I_price = this.config.getInt("knockback 1 price");
    81. knockback_II_price = this.config.getInt("knockback 2 price");
    82. power_I_price = this.config.getInt("power 1 price");
    83. power_II_price = this.config.getInt("power 2 price");
    84. power_III_price = this.config.getInt("power 3 price");
    85. infinity_I_price = this.config.getInt("infinty 1 pice");
    86. punch_I_price = this.config.getInt("punch 1 price");
    87. punch_II_price = this.config.getInt("punch 2 price");
    88. punch_III_price = this.config.getInt("punch 3 price");
    89. protection_I_price = this.config.getInt("protection 1 price");
    90. protection_II_price = this.config.getInt("protection 2 price");
    91. protection_III_price = this.config.getInt("protection 3 price");
    92. fireprotection_I_price = this.config.getInt("fire protection 1 price");
    93. fireprotection_II_price = this.config.getInt("fire protection 2 price");
    94. fireprotection_III_price = this.config.getInt("fire protection 3 price");
    95. thorns_I_price = this.config.getInt("thorns 1 price");
    96. thorns_II_price = this.config.getInt("thorns 2 price");
    97. thorns_III_price = this.config.getInt("thorns 3 price");
    98. projectileprojection_I_price = this.config.getInt("projectile projection 1 price");
    99. projectileprojection_II_price = this.config.getInt("projectile projection 2 price");
    100. projectileprojection_II_price = this.config.getInt("projectile projection 3 price");
    101.  
    102.  
    103. }
    104. @Override
    105. public void onDisable(){
    106. logger.info("----------------------------------------------------------");
    107. logger.info(" Eternal Kit PVP disable! ");
    108. logger.info("----------------------------------------------------------");
    109. }
    110.  
    111. private boolean setupEconomy()
    112. {
    113. if (getServer().getPluginManager().getPlugin("Vault") == null)
    114. {
    115. return false;
    116. }
    117. RegisteredServiceProvider rsp = getServer().getServicesManager().getRegistration(Economy.class);
    118. if (rsp == null)
    119. {
    120. return false;
    121. }
    122. econ = (Economy)rsp.getProvider();
    123. return econ != null;
    124. }
    125. private boolean setupChat() {
    126. RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
    127. chat = rsp.getProvider();
    128. return chat != null;
    129. }
    130.  
    131. private boolean setupPermissions() {
    132. RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
    133. perms = rsp.getProvider();
    134. return perms != null;
    135. }
    136.  
    137. public void checkconfig(){
    138. this.file = new File(getDataFolder(), "config.yml");
    139. if(!this.file.exists()){
    140. logger.info("[EternalKitPvP] Configuration file does not exist, creating one");
    141. }
    142. this.file.getParentFile().mkdirs();
    143. try{
    144. saveDefaultConfig();
    145. }
    146. catch (Exception e){
    147. e.printStackTrace();
    148. {
    149. }
    150. if (this.logToConsole){
    151. logger.info("[EternalKitPvP] Configuration file loaded");
    152. }
    153.  
    154. }
    155. }
    156. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    157. //Player player = (Player) sender;
    158. //Now, you can do whatever you want with the CommandSender, Command, args[] so here's an example
    159. //--------------------------------------credits command----------------------------------------------------
    160. if(cmd.getName().equalsIgnoreCase("credits")){
    161. sender.sendMessage(ChatColor.RED + "You have " + econ.getBalance(sender.getName()) + " worth of tokens");
    162. return true;
    163. }
    164. //--------------------------------------kpenchant list command----------------------------------------------------
    165. if(cmd.getName().equalsIgnoreCase("kpenchantlist")){
    166. sender.sendMessage(ChatColor.GREEN + "List of possible enchantments:");
    167. sender.sendMessage(ChatColor.RED + "Sword: Sharpness I-III, Fire Aspect I-II, Knockback I-II");
    168. sender.sendMessage(ChatColor.RED + "Bow: Power I-III, Punch I-III, Flame I, Infinity I");
    169. sender.sendMessage(ChatColor.RED + "Armor: Protection I-III, Fire Protection I-III, Thorns I-III, Projectile Projection III");
    170.  
    171. return true;
    172. }
    173. return false;
    174. }
    175. }
    176.  
    177.  

     
  2. Offline

    fireblast709

    you forgot the @EventHandler annotation above onPlayerKill
     
  3. Offline

    slater96

    @EventHandler above the player death event, but...why do you have two?
     
  4. Offline

    mydeblob

    fireblast709
    Added that. Didn't realize you needed it for every event. Still doesn't do what it's suppose to though.
    slater96
    On one player death event it is for if the player dies "naturally" and the other is for if a player kills another player. If you think I should combine these to events into one with if loops, I will.

    slater96
    Just tryed removing 1 of the events. Didn't do anything

    Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  5. Offline

    Axe2760

    In that massive onEnable, I don't think you registered events?
     
  6. Offline

    mydeblob

    Axe2760
    Haha, it is quite massive :p I did indeed register them though, first line
    Code:java
    1. getServer().getPluginManager().registerEvents(new PlayerKillEventListener(),this);
     
    Axe2760 likes this.
  7. 1. Why you need @EventHandler: The @EventHandler annotation is used by bukkit to determine which methods should be analyzed for event handling. Therefor it is needed to be before any event handler method, or the method will be ignored when you register the event listener.

    2. You should use only one event method for each event type in the same listener. Regardless how bukkit implements it internally (being able to have the event type in two or more methods or not), it's an additional method call, and all deaths would be handled by your plugin twice. Using an if your would be more elegant imho.
     
  8. Offline

    mydeblob

    hapm
    Ok, Thanks for explaining the annotation of eventhandler. And I have made it into one event. Thanks for the tips! But, none the less for some reason the event's are still not working
     
  9. Offline

    xTrollxDudex

    mydeblob
    I see your victim and killer are exactly the same thing :p
     
  10. Offline

    mydeblob

    xTrollxDudex
    Ya, I did that so I could read my code easier, I don't think it should interfere with the code at all. Atleast from what I know :p
     
  11. Offline

    Saposhiente

    Specify @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) and then show us your current code.
     
  12. Offline

    mydeblob

    Saposhiente
    With that, it still isn't working. It isn't even sending the player the message. Here is some updated code:
    Main class:
    Show Spoiler

    Code:java
    1. package mydeblob.eternalsurvival.kitpvp;
    2.  
    3. import java.io.File;
    4. import java.util.logging.Logger;
    5. import net.milkbowl.vault.chat.Chat;
    6. import net.milkbowl.vault.economy.Economy;
    7. import org.bukkit.ChatColor;
    8. import org.bukkit.command.Command;
    9. import org.bukkit.command.CommandSender;
    10. import org.bukkit.configuration.file.FileConfiguration;
    11. import org.bukkit.configuration.file.YamlConfiguration;
    12. import org.bukkit.permissions.Permission;
    13. import org.bukkit.plugin.RegisteredServiceProvider;
    14. import org.bukkit.plugin.java.JavaPlugin;
    15.  
    16. public class KitPvpMain extends JavaPlugin{
    17. public static KitPvpMain plugin;
    18. public static Logger logger = Logger.getLogger("Minecraft");
    19. private File file;
    20. public boolean logToConsole;
    21. public static Economy econ = null;
    22. public static Chat chat = null;
    23. public static Permission perms = null;
    24. File configfile;
    25. FileConfiguration config;
    26.  
    27. //-----------------CONFIG OPTIONS----------------
    28. public static int sharpness_I_price;
    29. public static int sharpness_II_price;
    30. public static int sharpness_III_price;
    31. public static int fireaspect_I_price;
    32. public static int fireaspect_II_price;
    33. public static int knockback_I_price;
    34. public static int knockback_II_price;
    35. public static int power_I_price;
    36. public static int power_II_price;
    37. public static int power_III_price;
    38. public static int punch_I_price;
    39. public static int punch_II_price;
    40. public static int punch_III_price;
    41. public static int infinity_I_price;
    42. public static int protection_I_price;
    43. public static int protection_II_price;
    44. public static int protection_III_price;
    45. public static int fireprotection_I_price;
    46. public static int fireprotection_II_price;
    47. public static int fireprotection_III_price;
    48. public static int thorns_I_price;
    49. public static int thorns_II_price;
    50. public static int thorns_III_price;
    51. public static int projectileprojection_I_price;
    52. public static int projectileprojection_II_price;
    53. public static int projectileprojection_III_price;
    54.  
    55.  
    56. @Override
    57. public void onEnable(){
    58. if (!setupEconomy()){
    59. logger.info("----------------------------------------------------------");
    60. logger.info("Eternal Kit PVP disable due to no Vault dependency found!");
    61. logger.info("----------------------------------------------------------");
    62. return;
    63. }
    64. setupPermissions();
    65. setupChat();
    66. getServer().getPluginManager().registerEvents(new PlayerKillEventListener(), this);
    67. //---------------------Configuration File---------------------
    68. this.configfile = new File(getDataFolder(), "config.yml");
    69. this.config = YamlConfiguration.loadConfiguration(this.configfile);
    70. saveConfig();
    71. reloadConfig();
    72. this.config = getConfig();
    73.  
    74.  
    75. sharpness_I_price = this.config.getInt("sharpness 1 price");
    76. sharpness_II_price = this.config.getInt("sharpness 2 price");
    77. sharpness_III_price = this.config.getInt("sharpness 3 price");
    78. fireaspect_I_price = this.config.getInt("fireaspect 1 price");
    79. fireaspect_II_price = this.config.getInt("fireaspect 2 price");
    80. knockback_I_price = this.config.getInt("knockback 1 price");
    81. knockback_II_price = this.config.getInt("knockback 2 price");
    82. power_I_price = this.config.getInt("power 1 price");
    83. power_II_price = this.config.getInt("power 2 price");
    84. power_III_price = this.config.getInt("power 3 price");
    85. infinity_I_price = this.config.getInt("infinty 1 pice");
    86. punch_I_price = this.config.getInt("punch 1 price");
    87. punch_II_price = this.config.getInt("punch 2 price");
    88. punch_III_price = this.config.getInt("punch 3 price");
    89. protection_I_price = this.config.getInt("protection 1 price");
    90. protection_II_price = this.config.getInt("protection 2 price");
    91. protection_III_price = this.config.getInt("protection 3 price");
    92. fireprotection_I_price = this.config.getInt("fire protection 1 price");
    93. fireprotection_II_price = this.config.getInt("fire protection 2 price");
    94. fireprotection_III_price = this.config.getInt("fire protection 3 price");
    95. thorns_I_price = this.config.getInt("thorns 1 price");
    96. thorns_II_price = this.config.getInt("thorns 2 price");
    97. thorns_III_price = this.config.getInt("thorns 3 price");
    98. projectileprojection_I_price = this.config.getInt("projectile projection 1 price");
    99. projectileprojection_II_price = this.config.getInt("projectile projection 2 price");
    100. projectileprojection_II_price = this.config.getInt("projectile projection 3 price");
    101.  
    102.  
    103. }
    104. @Override
    105. public void onDisable(){
    106. logger.info("----------------------------------------------------------");
    107. logger.info(" Eternal Kit PVP disable! ");
    108. logger.info("----------------------------------------------------------");
    109. }
    110.  
    111. private boolean setupEconomy()
    112. {
    113. if (getServer().getPluginManager().getPlugin("Vault") == null)
    114. {
    115. return false;
    116. }
    117. RegisteredServiceProvider rsp = getServer().getServicesManager().getRegistration(Economy.class);
    118. if (rsp == null)
    119. {
    120. return false;
    121. }
    122. econ = (Economy)rsp.getProvider();
    123. return econ != null;
    124. }
    125. private boolean setupChat() {
    126. RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
    127. chat = rsp.getProvider();
    128. return chat != null;
    129. }
    130.  
    131. private boolean setupPermissions() {
    132. RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
    133. perms = rsp.getProvider();
    134. return perms != null;
    135. }
    136.  
    137. public void checkconfig(){
    138. this.file = new File(getDataFolder(), "config.yml");
    139. if(!this.file.exists()){
    140. logger.info("[EternalKitPvP] Configuration file does not exist, creating one");
    141. }
    142. this.file.getParentFile().mkdirs();
    143. try{
    144. saveDefaultConfig();
    145. }
    146. catch (Exception e){
    147. e.printStackTrace();
    148. {
    149. }
    150. if (this.logToConsole){
    151. logger.info("[EternalKitPvP] Configuration file loaded");
    152. }
    153.  
    154. }
    155. }
    156. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    157. //Player player = (Player) sender;
    158. //Now, you can do whatever you want with the CommandSender, Command, args[] so here's an example
    159. //--------------------------------------credits command----------------------------------------------------
    160. if(cmd.getName().equalsIgnoreCase("credits")){
    161. sender.sendMessage(ChatColor.RED + "You have " + econ.getBalance(sender.getName()) + " worth of tokens");
    162. return true;
    163. }
    164. //--------------------------------------kpenchant list command----------------------------------------------------
    165. if(cmd.getName().equalsIgnoreCase("kpenchantlist")){
    166. sender.sendMessage(ChatColor.GREEN + "List of possible enchantments:");
    167. sender.sendMessage(ChatColor.RED + "Sword: Sharpness I-III, Fire Aspect I-II, Knockback I-II");
    168. sender.sendMessage(ChatColor.RED + "Bow: Power I-III, Punch I-III, Flame I, Infinity I");
    169. sender.sendMessage(ChatColor.RED + "Armor: Protection I-III, Fire Protection I-III, Thorns I-III, Projectile Projection III");
    170.  
    171. return true;
    172. }
    173. return false;
    174. }
    175. //End of commands, start of events
    176.  
    177.  
    178. }


    Event Class:
    Show Spoiler

    Code:java
    1. package mydeblob.eternalsurvival.kitpvp;
    2.  
    3. import net.milkbowl.vault.economy.Economy;
    4.  
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.event.EventHandler;
    7. import org.bukkit.event.EventPriority;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.event.entity.PlayerDeathEvent;
    10.  
    11. public class PlayerKillEventListener implements Listener{
    12. public static Economy econ = null;
    13. @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    14. public void onPlayerDeath(PlayerDeathEvent event){
    15. Player victim = event.getEntity();
    16. Player killer = event.getEntity();
    17. Player p = event.getEntity();
    18. if(event.getEntity() instanceof Player){
    19. //If loops for subtracting balance
    20. if(econ.getBalance(victim.getName()) > 25){
    21. double highdeposit = econ.getBalance(victim.getName()) % 15;
    22. econ.withdrawPlayer(victim.getName(), highdeposit);
    23. victim.sendMessage("You lost" + highdeposit + "worth of tokens for getting killed by" + killer.getKiller());
    24. }else{
    25. double lowdeposit = econ.getBalance(victim.getName()) % 5;
    26. econ.withdrawPlayer(victim.getName(), lowdeposit);
    27. victim.sendMessage("You lost" + lowdeposit + "worth of tokens for getting killed by" + killer.getKiller());
    28. }
    29. //if(else) loop if the player died from natural damage
    30. }else{
    31. if(econ.getBalance(victim.getName()) > 25){
    32. double highdeposit = econ.getBalance(victim.getName()) % 15;
    33. econ.withdrawPlayer(victim.getName(), highdeposit);
    34. victim.sendMessage("You lost" + highdeposit + "worth of tokens for dying");
    35. }else{
    36. double lowdeposit = econ.getBalance(victim.getName()) % 5;
    37. econ.withdrawPlayer(victim.getName(), lowdeposit);
    38. victim.sendMessage("You lost" + lowdeposit + "worth of tokens for dying");
    39. }if (killer.getKiller() instanceof Player) {
    40. if(econ.getBalance(p.getName()) > 25){
    41. double highdeposit = econ.getBalance(killer.getName()) % 15;
    42. econ.depositPlayer(killer.getName(), highdeposit);
    43. killer.sendMessage("You gained" + highdeposit + "worth of tokens for killing" + p.getName());
    44. }else{
    45. double lowdeposit = econ.getBalance(killer.getName()) % 5;
    46. econ.depositPlayer(killer.getName(), lowdeposit);
    47. killer.sendMessage("You gained" + lowdeposit + "worth of tokens for killing" + p.getName());
    48. }
    49. if(econ.getBalance(p.getName()) == 0){
    50. econ.depositPlayer(killer.getName(), 2);
    51. killer.sendMessage("You gained $2 worth of tokens for killing" + p.getName());
    52. }
    53.  
    54.  
    55. }
    56. }
    57. }
    58. }//End of playerdeath event
    59.  



    I am now getting StackTraces on the death event... I'm getting somewhere :D
    HTML:
    19.08 17:57:17 [Server] INFO ... 24 more
    19.08 17:57:17 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
    19.08 17:57:17 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:601)
    19.08 17:57:17 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    19.08 17:57:17 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    19.08 17:57:17 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    19.08 17:57:17 [Server] INFO at mydeblob.eternalsurvival.kitpvp.PlayerKillEventListener.onPlayerDeath(PlayerKillEventListener.java:20)
    19.08 17:57:17 [Server] INFO Caused by: java.lang.NullPointerException
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:226)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:590)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.DedicatedServerConnection.b(SourceFile:30)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.ServerConnection.b(SourceFile:37)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.PlayerConnection.e(PlayerConnection.java:118)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.NetworkManager.b(NetworkManager.java:296)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.Packet10Flying.handle(SourceFile:136)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.PlayerConnection.a(PlayerConnection.java:421)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityPlayer.b(EntityPlayer.java:475)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityLiving.a(EntityLiving.java:135)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.Entity.a(Entity.java:771)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityHuman.b(EntityHuman.java:1295)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityLiving.b(EntityLiving.java:828)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityPlayer.damageEntity(EntityPlayer.java:370)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityHuman.damageEntity(EntityHuman.java:704)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityLiving.damageEntity(EntityLiving.java:687)
    19.08 17:57:17 [Server] INFO at net.minecraft.server.v1_6_R2.EntityPlayer.die(EntityPlayer.java:299)
    19.08 17:57:17 [Server] INFO at org.bukkit.craftbukkit.v1_6_R2.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:345)
    19.08 17:57:17 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
    19.08 17:57:17 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    19.08 17:57:17 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    19.08 17:57:17 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
    19.08 17:57:17 [Server] INFO org.bukkit.event.EventException
    19.08 17:57:17 [Server] SEVERE Could not pass event PlayerDeathEvent to EternalKitPvP v1.0
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  13. Offline

    Lactem

    Then you called a method on econ.
    That generated a NullPointerException because you cannot call a method on something that is null.
     
    Axe2760 likes this.
Thread Status:
Not open for further replies.

Share This Page