Armor Glitch

Discussion in 'Plugin Development' started by flash1110, Jun 4, 2016.

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

    flash1110

    Code:
    if (cp == null) {
                return;
            }
           
            if (cp.getCombatTime() > 0) {
                player.setHealth(0.0);
                Bukkit.broadcastMessage(ChatColor.GRAY + player.getDisplayName() + ChatColor.RED + " logged out in combat");
            }
    this code is ran on PlayerQuit. Here is a description of the glitch from a player:

    there is an extremely OP glitch with the combat logging plugin Basically, if you have armor on and you combat log When you go to pvp it will still have your armor on But not have it on if that makes sense You will still take the same amount of dmg that you did with the armor that you had on when you pvp logged But you wont have it on So if you pvp log in diamond armor When youcome back online Even though you dont have any armor on It will still make you take the same amount of dmg you took when you had the darmor on So insteead of it taking 3 hits to kill you with a stone sword, it takes like 20 And people are abusing it badly They log out with prot IV so they can have unbreakable prot IV where if they die they wont lose any armor I don't know how we can patch it though
     
  2. Offline

    N00BHUN73R

    @flash1110
    I mean, can't you just add them to an arraylist so when they join then kill them, or set their armour to null? I think that would fix it.
     
  3. Offline

    flash110

    @flash1110 First of all, nice name! xD Second of all when the player logs in, if the player is kept in a list of some sort from when they combat logged, get that players inventory and set their item slots for armor to air or null, than kill them. Make sure you do not do this on the same tick, that could be causing the glitch. It is a weird glitch anyways.
     
  4. Offline

    flash1110

    @N00BHUN73R @flash110

    The players are objects called CombatPlayer, it is stored in the object and saved/loaded on enable and disable.
     
Thread Status:
Not open for further replies.

Share This Page