Conversation
Added various spear items to the weapons group.
WalkthroughA resource pack configuration file was updated to include seven new spear item variants (wooden, stone, copper, iron, golden, diamond, and netherite) in the weapons item group list. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/main/resources/resourcepacks/default/assets/itemswapper/itemgroups/v2/weapons.json`:
- Around line 26-32: The listed "minecraft:*_spear" entries
(minecraft:wooden_spear, stone_spear, copper_spear, iron_spear, golden_spear,
diamond_spear, netherite_spear) are only valid in 1.21.11+, so either remove
these spear entries from the weapons item group or implement version-conditional
logic so they are only included when the runtime/game version >= 1.21.11; to
fix, update the weapons.json item group to omit those spear IDs for older
versions or modify the loader that builds item groups to check the game version
and only inject the spear IDs for 1.21.11 and above (identify the weapons.json
item group and the code path that reads/merges item groups to add the
conditional logic).
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1a2c30f7-be4d-4e3c-bdd8-1e2af7034782
📒 Files selected for processing (1)
src/main/resources/resourcepacks/default/assets/itemswapper/itemgroups/v2/weapons.json
| "minecraft:wooden_spear", | ||
| "minecraft:stone_spear", | ||
| "minecraft:copper_spear", | ||
| "minecraft:iron_spear", | ||
| "minecraft:golden_spear", | ||
| "minecraft:diamond_spear", | ||
| "minecraft:netherite_spear" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Find project MC/version metadata to understand the target runtime
echo "=== Project Metadata ==="
fd 'gradle.properties|build.gradle|build.gradle.kts|fabric.mod.json|mods.toml|neoforge.mods.toml' 2>/dev/null | head -20
# Check common build/metadata files
echo -e "\n=== Checking for build files ==="
ls -la | grep -E 'build|gradle|maven' || echo "No build files found in root"
# 2) Inspect all spear IDs and namespaces in resources
echo -e "\n=== All spear references in resources ==="
rg -n '"[a-z0-9_\-]+:(wooden|stone|copper|iron|golden|diamond|netherite)_spear"' src/main/resources 2>/dev/null || echo "No spear IDs found with that pattern"
# 3) Check broader spear namespace usage
echo -e "\n=== All spear references (broader search) ==="
rg -n 'spear' src/main/resources 2>/dev/null | head -30
# 4) Check the weapons.json file specifically
echo -e "\n=== weapons.json content ==="
cat -n src/main/resources/resourcepacks/default/assets/itemswapper/itemgroups/v2/weapons.json 2>/dev/null | head -40Repository: tr7zw/ItemSwapper
Length of output: 3864
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check the main fabric.mod.json for version requirements and dependencies
echo "=== Main fabric.mod.json ==="
cat -n src/main/resources/fabric.mod.json
echo -e "\n=== Version-specific fabric.mod.json (1.20.1) ==="
cat -n versions/1.20.1-fabric/src/main/resources/fabric.mod.json 2>/dev/null || echo "File not found"
echo -e "\n=== Version-specific fabric.mod.json (1.20.2) ==="
cat -n versions/1.20.2-fabric/src/main/resources/fabric.mod.json 2>/dev/null || echo "File not found"
# Check for gradle.properties to see version info
echo -e "\n=== gradle.properties ==="
cat -n gradle.properties 2>/dev/null | head -30
# Look for any build.gradle or build.gradle.kts
echo -e "\n=== build.gradle or build.gradle.kts ==="
find . -maxdepth 2 -name 'build.gradle*' -type f -exec cat -n {} \; 2>/dev/null | head -60Repository: tr7zw/ItemSwapper
Length of output: 9353
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Try to read gradle.properties without head/tail restrictions
echo "=== gradle.properties full content ==="
wc -l gradle.properties 2>/dev/null && cat gradle.properties 2>/dev/null || echo "File empty or not found"
# Look for any version configuration in root files
echo -e "\n=== Checking for version in directory structure ==="
ls -la versions/ 2>/dev/null | grep -E 'fabric|neoforge' || echo "No version directories found"
# Search for MC version in any gradle file
echo -e "\n=== Searching for minecraft version in gradle files ==="
find . -maxdepth 3 -name 'build.gradle*' -type f 2>/dev/null | while read f; do
echo "File: $f"
grep -i -E 'minecraft|version' "$f" 2>/dev/null | head -10
done
# Check settings.gradle
echo -e "\n=== settings.gradle if exists ==="
cat settings.gradle 2>/dev/null || echo "No settings.gradle"Repository: tr7zw/ItemSwapper
Length of output: 1045
🌐 Web query:
when were spears added to minecraft vanilla items 1.21
💡 Result:
Spears were added to vanilla Minecraft (Java Edition) in version 1.21.11 (the “Mounts of Mayhem” drop), which released on December 9, 2025. [1], [2]
Sources:
[1] Minecraft.net — Minecraft Java Edition 1.21.11 (official changelog) (minecraft.net)
[2] Minecraft Wiki (Fandom) — Java Edition 1.21.11 (minecraft.fandom.com)
Citations:
- 1: https://www.minecraft.net/fr-ca/article/minecraft-java-edition-1-21-11
- 2: https://minecraft.fandom.com/wiki/Java_Edition_1.21.11?utm_source=openai
Remove spear entries or add version-conditional logic—spears do not exist in vanilla Minecraft before 1.21.11.
Lines 26–32 reference minecraft:*_spear items, which were not added to vanilla Minecraft until version 1.21.11 (released December 9, 2025). The project supports versions 1.19.4 through 1.21.11, meaning these entries will fail to resolve silently on roughly 92% of supported versions (1.19.4, 1.20.1, 1.20.2, 1.20.4, 1.20.6, 1.21.1, 1.21.3, 1.21.4, 1.21.5, 1.21.8, 1.21.10). Either remove these entries or implement version-specific item configuration to include them only for 1.21.11+.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@src/main/resources/resourcepacks/default/assets/itemswapper/itemgroups/v2/weapons.json`
around lines 26 - 32, The listed "minecraft:*_spear" entries
(minecraft:wooden_spear, stone_spear, copper_spear, iron_spear, golden_spear,
diamond_spear, netherite_spear) are only valid in 1.21.11+, so either remove
these spear entries from the weapons item group or implement version-conditional
logic so they are only included when the runtime/game version >= 1.21.11; to
fix, update the weapons.json item group to omit those spear IDs for older
versions or modify the loader that builds item groups to check the game version
and only inject the spear IDs for 1.21.11 and above (identify the weapons.json
item group and the code path that reads/merges item groups to add the
conditional logic).
|
I think this PR is redundant by #264 |
|
Plan is to get #264 into the next release before working on more changes on the code. |
|
Got implemented. |
Added various spear items to the weapons group.