Buggy code:
public class AncientRPGPlayerListener implements Listener { public static final Collection < UUID > toggleguildlist = Collections . newSetFromMap ( new ConcurrentHashMap < UUID , Boolean > ( ) ) ; public static final Collection < UUID > togglepartylist = Collections . newSetFromMap ( new ConcurrentHashMap < UUID , Boolean > ( ) ) ; public static LinkedHashMap < UUID , Double > healpotions = new LinkedHashMap < UUID , Double > ( ) ; public static final HashMap < UUID , Integer > invisibleList = new HashMap < UUID , Integer > ( ) ; public static final HashMap < UUID , UUID > summonedCreatures = new HashMap < UUID , UUID > ( ) ; private static final HashMap < UUID , AncientRPGClass > prevClasses = new HashMap < UUID , AncientRPGClass > ( ) ; private static final HashMap < UUID , String > prevStances = new HashMap < UUID , String > ( ) ; public static EventPriority guildSpawnPriority = EventPriority . HIGHEST ; public static EventPriority raceSpawnPriority = EventPriority . HIGHEST ; public static AncientRPG plugin ; public static int invisId = 0 ; public AncientRPGPlayerListener ( AncientRPG instance ) { } public static int addInvis ( Player p ) { } public static void setAllVisible ( Player p ) { } public static void setVisibleToAll ( Player p ) { } public static boolean removeInvis ( Player p , int id ) { } @ EventHandler public void onPlayerChangeWorld ( PlayerChangedWorldEvent event ) { Player p = event . getPlayer ( ) ; PlayerData pd = PlayerData . getPlayerData ( p . getUniqueId ( ) ) ; AncientRPGClass currentClass = classList . get ( pd . getClassName ( ) . toLowerCase ( ) ) ; AncientRPGClass prevClass = AncientRPGPlayerListener . prevClasses . get ( p . getUniqueId ( ) ) ; pd . getHpsystem ( ) . setMaxHP ( ) ; pd . getHpsystem ( ) . setHpRegen ( ) ; if ( prevClass != null ) { if ( prevClass . isWorldEnabled ( p . getWorld ( ) ) ) { <START_BUG> ClassSetCommand . setClass ( prevClass , currentClass , p , p ) ; <END_BUG> AncientRPGPlayerListener . prevClasses . remove ( p . getUniqueId ( ) ) ; if ( AncientRPGPlayerListener . prevStances . containsKey ( p . getUniqueId ( ) ) ) pd . setStance ( AncientRPGPlayerListener . prevStances . remove ( p . getUniqueId ( ) ) ) ; } return ; } if ( currentClass != null ) { if ( ! ( currentClass . isWorldEnabled ( p . getWorld ( ) ) ) ) { ClassResetCommand . reset ( p , currentClass , pd ) ; if ( ! ( AncientRPGPlayerListener . prevClasses . containsKey ( p . getUniqueId ( ) ) ) ) AncientRPGPlayerListener . prevClasses . put ( p . getUniqueId ( ) , currentClass ) ; } AncientRPGClass stance = currentClass . stances . get ( pd . getStance ( ) ) ; if ( ( stance != null ) && ( ! ( stance . isWorldEnabled ( p . getWorld ( ) ) ) ) ) { pd . setStance ( "" ) ; if ( ! ( AncientRPGPlayerListener . prevStances . containsKey ( p . getUniqueId ( ) ) ) ) AncientRPGPlayerListener . prevStances . put ( p . getUniqueId ( ) , pd . getStance ( ) ) ; } } } @ EventHandler ( priority = EventPriority . LOWEST ) public void onPlayerConnect ( PlayerJoinEvent event ) { } @ EventHandler public void onPlayerDisconnect ( PlayerQuitEvent event ) { } @ EventHandler public void onPlayerRespawn ( PlayerRespawnEvent event ) { } @ EventHandler public void onInventoryClose ( final InventoryCloseEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onPlayerPickupItem ( final PlayerPickupItemEvent event ) { } @ EventHandler public void onPlayerItemHeld ( final PlayerItemHeldEvent event ) { } @ EventHandler public void onPlayerChat ( AsyncPlayerChatEvent event ) { } @ EventHandler public void onPlayerMove ( PlayerMoveEvent event ) { } public static boolean damageignored = false ; @ EventHandler public void onPlayerDamage ( EntityDamageEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onPlayerItemConsume ( PlayerItemConsumeEvent event ) { } @ EventHandler public void onPlayerInteract ( PlayerInteractEvent event ) { } No newline ; at end ; of file ; }

Fix:
ClassSetCommand . setClass ( prevClass , currentClass , p , Bukkit . getConsoleSender ( ) ) ;