Skip to content

Add spear items to weapons.json#265

Closed
ChromesDuzez wants to merge 1 commit intotr7zw:mainfrom
ChromesDuzez:patch-1
Closed

Add spear items to weapons.json#265
ChromesDuzez wants to merge 1 commit intotr7zw:mainfrom
ChromesDuzez:patch-1

Conversation

@ChromesDuzez
Copy link

Added various spear items to the weapons group.

Added various spear items to the weapons group.
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Walkthrough

A 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

Cohort / File(s) Summary
Weapon Variants Configuration
src/main/resources/resourcepacks/default/assets/itemswapper/itemgroups/v2/weapons.json
Added seven spear variants to the weapons item group list following the wooden_axe entry. The ignoreItems section remains unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding spear items to the weapons.json configuration file.
Description check ✅ Passed The description is directly related to the changeset, explaining that various spear items were added to the weapons group.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c83f34d and 01c5901.

📒 Files selected for processing (1)
  • src/main/resources/resourcepacks/default/assets/itemswapper/itemgroups/v2/weapons.json

Comment on lines +26 to +32
"minecraft:wooden_spear",
"minecraft:stone_spear",
"minecraft:copper_spear",
"minecraft:iron_spear",
"minecraft:golden_spear",
"minecraft:diamond_spear",
"minecraft:netherite_spear"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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 -40

Repository: 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 -60

Repository: 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:


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).

@tr7zw
Copy link
Owner

tr7zw commented Mar 4, 2026

I think this PR is redundant by #264

@ChromesDuzez
Copy link
Author

I think this PR is redundant by #264

I missed it the first time, but yes you are correct it is redundant. Although the benefit to this PR is that it is a quick small change rather than PR #264 which is a decently large PR.

@tr7zw
Copy link
Owner

tr7zw commented Mar 5, 2026

Plan is to get #264 into the next release before working on more changes on the code.

@tr7zw
Copy link
Owner

tr7zw commented Mar 13, 2026

Got implemented.

@tr7zw tr7zw closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants