Skip to content

Instantly share code, notes, and snippets.

@exp111
Last active February 12, 2022 12:09
Show Gist options
  • Save exp111/ae85a348843c3276616f854c7784230c to your computer and use it in GitHub Desktop.
Save exp111/ae85a348843c3276616f854c7784230c to your computer and use it in GitHub Desktop.
Minecraft Config Setter

What does it do

Sets the options to my preference (and you can't do anything about that) Changes:

Audio

  • Master Audio to 20%

Video

  • Brightness to max
  • GUI Size to Large (3)
  • Mipmap Levels to 0
  • Disables VSync

Controls

  • Disables Auto jump
  • Inventory to Tab (fight me)
  • List Players to ä/apostrophe

Misc Stuff

  • Disables the multiplayer warning
  • Disables Tutorials
  • Disables snooper settings

I found https://github.com/theTisch21/Auto-MC-Config but it doesn't handle everything and uses node. Webd*vs at work

How to use

  • Run in the folder where the "options.txt" is Or
  • Set the Pre-launch command in MultiMC to PowerShell.exe -ExecutionPolicy RemoteSigned -command "..\..\..\setconfig.ps1"

Problems

May not work on the first run if the options file doesn't exist yet/is empty. TODO: handle this? can't be arsed, so just start the game twice smh Doesn't check if anything is there. if checks are for losers

$optionsFile = "options.txt";
$path = Convert-Path(".");
# $path = Join-Path -Path $path -ChildPath "minecraft";
$path = Join-Path -Path $path -ChildPath $optionsFile;
# Check if config file exists
if (Test-Path($path))
{
Write-Host "File exists";
$data = Get-Content $path;
### General
# fov to 88
$data = $data -replace "fov:\d(\.\d*)", "fov:0.45";
### Audio
# master to 0.2
$data = $data -replace "soundCategory_master:\d(\.\d+)?", "soundCategory_master:0.2";
$data = $data -replace "master:\d(\.\d+)?", "master:0.2";
### Video settings
# Max Brightness
$data = $data -replace "gamma:\d(\.\d)?", "gamma:1.0";
# gui level 3/large
$data = $data -replace "guiScale:\d", "guiScale:3";
# vsync off
$data = $data -replace "enableVsync:true", "enableVsync:false";
# mipmap 0
$data = $data -replace "mipmapLevels:\d", "mipmapLevels:0";
### Controls
# Disable Auto jump
$data = $data -replace "autoJump:true", "autoJump:false";
# change inventory to tab, list players to apostrophe/ae
## new keycode system
$data = $data -replace "key_key.inventory:key\..*", "key_key.inventory:key.keyboard.tab"; # TODO: check if anything else uses that key (modded binds)
$data = $data -replace "key_key.playerlist:key\..*", "key_key.playerlist:key.keyboard.apostrophe";
## old keycodes
$data = $data -replace "key_key.inventory:\d+", "key_key.inventory:15";
$data = $data -replace "key_key.playerlist:\d+", "key_key.playerlist:40";
### Misc
# disable mp warning
$data = $data -replace "skipMultiplayerWarning:false", "skipMultiplayerWarning:true";
# disable snooper
$data = $data -replace "snooperEnabled:true", "snooperEnabled:false";
# disable tutorial
$data = $data -replace "tutorialStep:.*", "tutorialStep:none";
# Write back
$data | Out-File -encoding ASCII $path;
}
else
{
# throw if you want the thing to die, problem: may stop the game from running if it hasn't created a config file yet
Write-Error "$optionsFile at $path doesn't exist";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment