The new Optifine previews have a few issues if you are using the OpenGL rendering engine. You will know if you have this glitch if your chat gets flooded with
OpenGL error(invalid enum): 1280
to fix this you need to install java. here is a link to the download
once that has been finished run your game once then close both the launcher and your game. re-open the launcher then go to the installations tab
Go to you current game version then click the three dots that show up when you hover over it. A drop down will appear, hit the edit button. Once you are in there hit the more options button. You should see something that says Java Executable.
click the browse button then navigate to your boot drive.
next do this C:>Program Files (x86)>Java
once you have opened the Java file there should be 1 file there. Open it (name of it may vary depending on the version of java you have). Once in the file open bin. You should see a bunch of files. Just scroll down untill you see the file named Java. Click on that then hit open. Boom it will no longer give you errors. It might prompt you when you open the multiplayer menu to allow java pass your firewall. Click allow or you cannot play multiplayer. Reply to this post if you are having trouble. It will also open another program that just has a blank empty screen when you launch, ignore that it does nothing I don’t really know how to get rid of it.