One Player wont take any damage

Discussion in 'Plugin Development' started by Irantwomiles, Jun 11, 2016.

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

    Irantwomiles

    I'm completely lost, I have this duel class where it manages duels and stuff like that. When I send two people in a match together one of them wont take any damage. Here is how I'm matching people up.

    Code:
        @SuppressWarnings("deprecation")
        public static void startBattle(Player player1, Player player2) {
            Duel d = new Duel(player1, player2);
        /*   
            for(Player p : Bukkit.getOnlinePlayers()) {
                player1.hidePlayer(p);
                player2.hidePlayer(p);
                player1.showPlayer(player2);
                player2.showPlayer(player1);
            }*/
           
            duel.add(d);
            battling.add(player1.getName());
            battling.add(player2.getName());
           
            player1.sendMessage(ChatColor.GREEN + "Match started with " + ChatColor.BLUE + player2.getName());
            player2.sendMessage(ChatColor.GREEN + "Match started with " + ChatColor.BLUE + player1.getName());
        }
    I have nothing changing the damage people are taking or anything of that sort. All I do is TP them to one area and thats it.
     
  2. Offline

    Zombie_Striker

    @Irantwomiles
    What you have to do now is debug and troubleshoot. Are there any other plugins on your server that may cause this to happen? Is there some sort of patter of who won't take damage? Can those players take damage any other way? Are the events even being triggered when one player hits another?
     
  3. Offline

    Irantwomiles

    Well I thought maybe the EntityDamagedByEntityEvent would be causing a problem so I added a message to check if the plugin was registering the player getting hit, which it is, I removed pretty much all of my plugins, except for essentials and worldedit/guard, I'm gonna remove those aswell. Then I thought maybe it was me hiding players for the arena thing that I have so I removed that part just to test it out, but that wasn't the problem either. I can't seem to find out what is the problem. And also the player that wont take damage wont take any form of damage, And its not just from the player either, no mob damage, potion damage, havent tried fall damage but I can safely assume that it wont take any either.

    EDIT: I removed world edit and world guard along with essentials and pex. It seems to be working. I don't know what could have caused the problem, but I'll edit this post again if I come across the problem again.
     
    Last edited: Jun 11, 2016
  4. Offline

    Zombie_Striker

    @Irantwomiles
    Can you use the Player#damage() event to damage a player? If so, then this is most likely a collision box problem. Try teleporting the player to their location again and see if this solved the problem. If not, then your bukkit/spigot may have a bug. In that case, post which version you are running.
     
  5. Offline

    Irantwomiles

    Ya I actually tried that. The player takes damage when I do that.
     
  6. Offline

    pookeythekid

    @Irantwomiles First off, love the clever name.
    Code:
    #The delay, in seconds, a player can't be attacked by other players after they have been teleported by a command.
    # This will also prevent the player attacking other players.
    teleport-invulnerability: 4
    This is in the Essentials config. You think it has anything to do with your problem?

    edit: I think 4 seconds is the default. I just went and grabbed this off of my last server backup.
     
  7. Offline

    Irantwomiles

    thats not the problem, you cant attack the player at all, there isn't a certain time that you cant attack.
     
  8. Offline

    Zombie_Striker

    @Irantwomiles
    If that is the case, have you tried re-teleporting the player?
     
  9. Offline

    Irantwomiles

    No. I didn't think since I was on my host and getting the best possible ping it would be the problem, i'll try it out and see.
     
Thread Status:
Not open for further replies.

Share This Page