Created
January 26, 2026 09:50
-
-
Save NextdoorPsycho/695fc021afcdaf962ba51a5565125f30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script to remove poppet/voodoo doll functionality from Bewitchment mod | |
| # This fixes crashes caused by the Voodoo dolls | |
| set -e | |
| # Save the working directory | |
| WORK_DIR="$(pwd)" | |
| # Find the bewitchment jar (excluding already processed ones) | |
| JAR_FILE=$(find "$WORK_DIR" -maxdepth 1 -name "bewitchment*.jar" ! -name "*-nopoppet.jar" | head -1) | |
| if [ -z "$JAR_FILE" ]; then | |
| echo "Error: No bewitchment JAR file found in current directory" | |
| exit 1 | |
| fi | |
| echo "Found JAR: $JAR_FILE" | |
| # Create temp directory | |
| TEMP_DIR=$(mktemp -d) | |
| echo "Extracting to: $TEMP_DIR" | |
| # Extract JAR | |
| unzip -q "$JAR_FILE" -d "$TEMP_DIR" | |
| # Edit bewitchment.mixins.json to remove poppet lines | |
| MIXINS_FILE="$TEMP_DIR/bewitchment.mixins.json" | |
| if [ -f "$MIXINS_FILE" ]; then | |
| echo "Removing poppet entries from bewitchment.mixins.json..." | |
| # Remove lines containing "poppet" and fix trailing commas | |
| sed -i.bak '/"poppet\./d' "$MIXINS_FILE" | |
| rm -f "$MIXINS_FILE.bak" | |
| else | |
| echo "Warning: bewitchment.mixins.json not found" | |
| fi | |
| # Delete the poppet mixin folder | |
| POPPET_DIR="$TEMP_DIR/moriyashiine/bewitchment/mixin/poppet" | |
| if [ -d "$POPPET_DIR" ]; then | |
| echo "Deleting poppet mixin folder..." | |
| rm -rf "$POPPET_DIR" | |
| else | |
| echo "Warning: poppet mixin folder not found" | |
| fi | |
| # Create new JAR name | |
| BASE_NAME=$(basename "$JAR_FILE" .jar) | |
| NEW_JAR="${BASE_NAME}-nopoppet.jar" | |
| echo "Creating new JAR: $NEW_JAR" | |
| # Repackage JAR | |
| cd "$TEMP_DIR" | |
| zip -r -q "$WORK_DIR/$NEW_JAR" . | |
| cd "$WORK_DIR" | |
| # Clean up temp directory | |
| rm -rf "$TEMP_DIR" | |
| # Delete original JAR | |
| echo "Deleting original JAR: $JAR_FILE" | |
| rm "$JAR_FILE" | |
| echo "" | |
| echo "Done! Created $NEW_JAR" | |
| echo "The poppet/voodoo doll functionality has been removed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment