Skip to content

Instantly share code, notes, and snippets.

@Phoenix616
Last active October 10, 2025 14:28
Show Gist options
  • Select an option

  • Save Phoenix616/c46a28abd0ecf4942afd1582cc3b697c to your computer and use it in GitHub Desktop.

Select an option

Save Phoenix616/c46a28abd0ecf4942afd1582cc3b697c to your computer and use it in GitHub Desktop.
Generate an anti xray pack for a specific version (https://modrinth.com/resourcepack/anti-xray-pack)
read -p "Enter the Minecraft version: " version
read -p "Enter the pack format: " pack_format
if [ ! -f ../versions/$version/$version.jar ]; then
echo "$version not found!"
exit 1
fi
echo "Unzipping version $version"
rm -r Anti_Xray_Build
mkdir -p Anti_Xray_Build
unzip ../versions/$version/$version.jar "assets/minecraft/blockstates/*" -d Anti_Xray_Build/
unzip ../versions/$version/$version.jar "assets/minecraft/models/block/*" -d Anti_Xray_Build/
echo "Updating Full pack with $version / $pack_format"
mkdir -p Anti_Xray_Full
rsync -avz --update --delete Anti_Xray_Build/assets Anti_Xray_Full
cd Anti_Xray_Full/
if (( pack_format < 69 )); then
echo "{
\"pack\": {
\"pack_format\": $pack_format,
\"description\": \"Anti-Xray Pack Full $version\"
}
}" > pack.mcmeta
else
echo "{
\"pack\": {
\"min_format\": $pack_format,
\"max_format\": [9001, 0],
\"description\": \"Anti-Xray Pack Full $version\"
}
}" > pack.mcmeta
fi
zip -r ../Anti_Xray_Full_$version.zip *
cd ../
echo "Updating Lite pack with $version / $pack_format"
mkdir -p Anti_Xray_Lite
rsync -avz --update --existing --delete Anti_Xray_Build/assets Anti_Xray_Lite
cd Anti_Xray_Lite/
if (( pack_format < 69 )); then
echo "{
\"pack\": {
\"pack_format\": $pack_format,
\"description\": \"Anti-Xray Pack Lite $version\"
}
}" > pack.mcmeta
else
echo "{
\"pack\": {
\"min_format\": $pack_format,
\"max_format\": [9001, 0],
\"description\": \"Anti-Xray Pack Lite $version\"
}
}" > pack.mcmeta
fi
zip -r ../Anti_Xray_Lite_$version.zip *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment