Good day. Faced a problem, from the run () method the countAnimationDisplayName variable is not visible.
The code itself:
tasks.put(player.getName(), new BukkitRunnable() { int countAnimationDisplayName = 0; public void run() { WrapperPlayServerScoreboardObjective objective = new WrapperPlayServerScoreboardObjective(); objective.setDisplayName(board.animationDisplayName.get(countAnimationDisplayName)); //objective. countAnimationDisplayName += 1; } }.runTaskTimer(this, 1L, intervalUpdate * 20L).getTaskId()); Error from IDE: countAnimationDisplayName cannot be resolved or is not a field