Solved [Help] Event Not Being Called!

Discussion in 'Plugin Development' started by XvBaseballkidvX, Dec 21, 2013.

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

    XvBaseballkidvX

    Hello everyone!
    I am working on a simple coin plugin to go along with Survival Games but I am having one small problem.

    If the player is one of the Survival Games arenas, my event wont get called! (Works fine if they aren't in an arena)

    Deposit Coins Class:
    Code:java
    1. @EventHandler(priority=EventPriority.HIGHEST)
    2. public void onDeath(PlayerDeathEvent event){
    3. Player player = event.getEntity();
    4. if(event.getEntity().getKiller() instanceof Player){
    5. Player killer = event.getEntity().getKiller();
    6. if(killer.getWorld().getName().equalsIgnoreCase("Destiny")){
    7.  
    8. Coins coins = Coins.getManager();
    9.  
    10. if(killer.hasPermission("coins.vip")){
    11. coins.addCoins(killer.getName(), 30);
    12. killer.sendMessage("§6+30 Coins!");
    13. }else{
    14. coins.addCoins(killer.getName(), 10);
    15. killer.sendMessage("§6+10 Coins!");
    16. }
    17.  
    18. Lists.getLists().removeFromHealthBoost(player.getName());
    19. int removeCoins = (int) coins.getCoins(player.getName()) / 10;
    20.  
    21. if(coins.getCoins(player.getName()) <= 10){
    22. player.sendMessage("§eYour coin amount was so low that the Coin Collector couldn't take anymore!");
    23. }else{
    24. coins.removeCoins(player.getName(), removeCoins);
    25. player.sendMessage("§c-" + removeCoins + " coins!");
    26. }
    27. }
    28. }
    29. }


    (Yes I have the Event Registered!)

    NOTE: Survival Games does use:
    Code:
    (priority=EventPriority.HIGHEST)
    In one of their death events.

    Thank you for reading!
    All help is much appreciated!

    I know this might be too early, but bump :I

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

    Compressions

    XvBaseballkidvX Maybe the arenas aren't in world "Destiny"? Please don't bump before 12 hours prior to the original post or bump.
     
  3. Offline

    XvBaseballkidvX

    Compressions It is, the event is not called when I am registered in the Arena. But works when I am not registered in the arena.

    Compressions , I know it has something to do with the Event Priority.

    Solved: Listened to a different event.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
Thread Status:
Not open for further replies.

Share This Page