When I use the function player.setGamemode(Gamemode.ADVENTURE), when I read the getGamemode() it says ADVENTURE, but I'm still being able to break blocks, anyone knows what happened?
By breaking blocks, you mean by hand? According to the docs: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/GameMode.html Code (Text): Enum Constant Description ADVENTURE Adventure mode cannot break blocks without the correct tools.
Have you tried to set your gamemode via the normal command to check if this is maybe a spigot-api error?