Using Minecraft cheats is not illegal, but it is against the game's terms of service. If you get caught cheating, you risk getting banned from the game or server.