๐
1 file
11,370 chars
๐
pasted-code-1787946773140.txt
txt
296 lines
โถ
pasted-code-1787946773140.txt
txt
296 lines
BUILD THE COMPLETE MINECRAFT MOD PROJECT FOR ME. DO NOT JUST EXPLAIN THE CODE. I WANT YOU TO ACTUALLY CREATE/OUTPUT THE COMPLETE PROJECT FILE STRUCTURE AND EVERY FILE'S COMPLETE CONTENT SO I CAN BUILD THE MOD AND PUT THE RESULTING JAR INTO MY SERVER.
PROJECT:
Mod name: Custom Arsenal
Mod ID: custom_arsenal
Package: com.aaron.customarsenal
Minecraft: Java Edition 1.21.1
Mod loader: Fabric
Use the correct Fabric API/Yarn mappings and Java version required for Minecraft 1.21.1.
IMPORTANT:
- Make the project compile.
- Fix any outdated/incorrect Minecraft 1.21.1 APIs in the code below.
- Do NOT blindly preserve broken imports or methods.
- If a method/API changed in 1.21.1, replace it with the correct 1.21.1 implementation.
- Give me a complete Gradle project.
- Include build.gradle, settings.gradle, gradle.properties, gradle wrapper configuration if needed, fabric.mod.json, mixins JSON if needed, Java source files, resources, item models, textures/placeholders if needed, and all other required files.
- Organize the code into proper files instead of putting everything into one enormous Java file if that is cleaner.
- The final project must build into a .jar.
- Do not leave TODOs, pseudocode, missing methods, or "you need to implement this" sections.
- If custom textures cannot be generated, create valid placeholder/generated resource files or clearly structure the resource paths so the mod still builds.
- The final answer should contain the COMPLETE project, not a tutorial.
CORE WEAPONS:
1. RIVEN
A Netherite sword.
- High-quality PvP sword.
- Applies Wither I on hit for 5 seconds.
- First player to use/claim it becomes its owner.
- Owner is stored on the ItemStack using CUSTOM_DATA/NbtComponent.
- Only the owner can use it.
- If dropped, other players cannot pick it up.
- Normal Minecraft sword behavior otherwise.
- Durability around Netherite level.
- Proper tooltip showing its ability and owner-bound status.
2. SHATTER
A Netherite-tier axe.
- Designed specifically to weaken armor/players in PvP.
- On hit, applies Weakness II for 5 seconds.
- Owner-bound like Riven.
- Do NOT turn it into a trident or spear.
- Keep it an axe.
- Proper attack damage/speed and durability.
- Tooltip describing armor-breaking/weakening ability.
3. SKEWER
A custom spear.
IMPORTANT: THIS MUST NOT BE A TRIDENT.
It should be implemented as a custom weapon, preferably extending SwordItem or another suitable weapon class.
- Netherite-tier.
- Extended melee reach.
- Around +1.5 blocks extra interaction/attack reach if supported correctly by 1.21.1 attributes.
- Around 7 attack damage total.
- Right-click performs a forward lunge.
- Lunge should launch the player in the direction they are looking.
- About 0.8 strength.
- About 3-second cooldown.
- Owner-bound.
- Proper tooltip.
- It must visually/functionally be a spear, but it must NOT use TridentItem or give trident abilities.
4. RUIN
A custom Mace weapon.
- Must be a Mace, not an axe/sword/trident.
- Netherite/high-tier weapon.
- On successful hit, create an AOE effect around the target.
- AOE radius approximately 5 blocks.
- Nearby living entities are damaged.
- AOE damage should be significant but balanced for PvP.
- Apply Slowness II for 3 seconds to nearby enemies.
- Do not damage the attacker.
- Owner-bound.
- Proper tooltip.
- Preserve appropriate mace behavior where possible.
5. GAZE NUKE
A custom fishing-rod-based orbital weapon.
IMPORTANT:
It is intentionally based on FishingRodItem, but it must NOT behave like a normal fishing rod.
Right-click should immediately activate the orbital strike.
NO fishing bobber.
NO normal fishing behavior.
Targeting:
- Use the player's crosshair/look direction.
- Maximum targeting range: 128 blocks.
- Raycast blocks and living entities.
- If an entity is directly targeted, use its position.
- Otherwise use the targeted block position.
- If nothing is hit, use the maximum-range point.
- The strike should happen wherever the player is aiming.
Attack:
Spawn 48 real TNT entities in a large dispersed orbital barrage.
Formation:
CENTER:
- 4 TNT
- roughly 12 blocks above target
- fuse 40 ticks
INNER RING:
- 8 TNT
- radius 3 blocks
- roughly 14 blocks above target
- fuse 50 ticks
MID RING:
- 14 TNT
- radius 6 blocks
- roughly 17 blocks above target
- fuse 60 ticks
OUTER RING:
- 22 TNT
- radius 10 blocks
- roughly 20 blocks above target
- fuse 80 ticks
Total = exactly 48 TNT.
TNT should be real Minecraft TNT entities so they actually explode normally.
Attribute TNT damage to the player who fired the weapon where Minecraft's API allows.
Cooldown approximately 20 seconds.
Durability cost approximately 10 per use.
Max stack size 1.
Owner-bound.
6. GAZE STAB
Another custom fishing-rod-based orbital weapon.
Again, NO normal fishing behavior.
Target:
- Crosshair/look direction.
- Maximum range 128 blocks.
- Same reliable raycast system as Gaze Nuke.
Attack:
Create a concentrated vertical TNT strike.
COLUMN:
- 15 TNT.
- Top starts approximately 25 blocks above target.
- Vertical spacing approximately 1.5 blocks.
- Slight random horizontal spread around 0.5 blocks.
- Top TNT fuse 30 ticks.
- Increase fuse by 3 ticks for each TNT lower in the column.
- This creates a downward cascading explosion.
CORE:
- 5 TNT.
- Around 1.5 block radius.
- Around 3 blocks above target.
- Fuse 50 ticks.
Total = exactly 20 TNT.
Cooldown approximately 15 seconds.
Durability cost approximately 8.
Max stack size 1.
Owner-bound.
No fishing bobber.
OWNER SYSTEM:
Every special weapon must support ownership.
When first obtained/used/claimed:
- Store player's UUID in the ItemStack CUSTOM_DATA component under "Owner".
- The owner can use the item.
- Other players cannot use it.
- If the item is dropped, other players must be prevented from picking it up.
- The owner can pick it up.
- If an unowned stack exists, first legitimate user/claimant can bind it.
- Owner UUID should not be displayed in an ugly way unless useful. A simple "Owner-bound weapon" tooltip is enough.
- Implement pickup protection correctly using a Fabric event or mixin.
- Do NOT create a fake unused utility method and call it finished.
CLAIM SYSTEM:
Add commands:
/arsenal claim
- Claims all Arsenal weapons/armor for the executing player.
- Prevent duplicate claims.
- Store persistent claims across server restarts.
/arsenal give_all
- Gives all Arsenal weapons and armor to the executing player.
/arsenal give
- Gives a specified Arsenal item.
Only operators/permission level 2+ should be able to use these commands.
PERSISTENT STATE:
Use Minecraft 1.21.1 PersistentState correctly.
Track:
player UUID -> claimed Arsenal item IDs.
Persist across server restarts.
Use the correct 1.21.1 PersistentState.Type/deserializer/writeNbt signatures.
Do not use obsolete APIs.
ARMOR:
Create four Netherite-tier Arsenal armor pieces:
- Arsenal Helmet
- Arsenal Chestplate
- Arsenal Leggings
- Arsenal Boots
Use proper 1.21.1 ArmorItem/ArmorMaterial APIs.
Make them valid armor items with Netherite-level protection/durability.
Register all four items.
Make proper item models.
Owner binding should work for armor too if practical, or at minimum they should be properly registered and obtainable through /arsenal give_all.
ITEM REGISTRATION:
Register:
custom_arsenal:riven
custom_arsenal:shatter
custom_arsenal:skewer
custom_arsenal:ruin
custom_arsenal:gaze_nuke
custom_arsenal:gaze_stab
custom_arsenal:arsenal_helmet
custom_arsenal:arsenal_chestplate
custom_arsenal:arsenal_leggings
custom_arsenal:arsenal_boots
IMPORTANT BUGS IN MY CURRENT CODE THAT YOU MUST FIX:
The following errors exist in my current implementation:
- ToolMaterial.getInverseTag() has an incompatible TagKey type because the correct Block import/type is missing.
- Fix the Block import and use net.minecraft.block.Block correctly.
- PersistentState is unresolved because the correct import/package/API needs to be used.
- Fix all PersistentState imports and 1.21.1 API usage.
- Fix all unchecked overrides.
- Remove unused imports.
- Fix Identifier/registry APIs where necessary.
- Fix command argument APIs for Minecraft 1.21.1.
- Fix ItemStack.damage API if necessary for 1.21.1.
- Fix ArmorItem/ArmorMaterial APIs if necessary.
- Fix EntityAttributeModifier constructors/IDs if necessary.
- Fix interaction reach attribute implementation for 1.21.1.
- Fix TntEntity constructor/API if necessary.
- Fix PersistentState.Type constructor/API if necessary.
- Fix all compile errors.
- Do not merely suppress errors.
- Make the final project compile.
MY CURRENT CODE CONCEPT IS BELOW. USE IT AS THE FUNCTIONAL REFERENCE, BUT CORRECT EVERYTHING NECESSARY FOR FABRIC/MINECRAFT 1.21.1:
[PASTE THE COMPLETE CustomArsenal.java CODE I PROVIDED AFTER THIS LINE]
The current design includes:
- ARSENAL_TOOL_MATERIAL using Netherite-tier stats.
- RivenItem extends SwordItem and applies Wither.
- ShatterItem extends AxeItem and applies Weakness.
- SkewerItem extends SwordItem and adds extended reach + lunge.
- RuinMaceItem extends MaceItem and performs AOE damage + Slowness.
- GazeNukeItem extends FishingRodItem and spawns 48 TNT in center/inner/mid/outer formations.
- GazeStabItem extends FishingRodItem and spawns 20 TNT in a vertical column + core.
- Owner UUID stored in DataComponentTypes.CUSTOM_DATA using NbtComponent.
- ArsenalState stores claimed weapons using PersistentState.
- /arsenal claim, /arsenal give_all, /arsenal give commands.
- Pickup protection is required.
FINAL PROJECT REQUIREMENTS:
1. Generate the complete folder tree.
2. Generate every required file.
3. Give the exact filename before each file.
4. Give the complete contents of each file.
5. Ensure package declarations match the folder paths.
6. Ensure imports are correct.
7. Ensure Gradle dependencies are correct for Fabric 1.21.1.
8. Ensure fabric.mod.json is correct.
9. Add mixins only where actually necessary.
10. Add item models/resources.
11. Add translations for all items and messages.
12. Add placeholder textures/resource structure if necessary.
13. Ensure the mod initializes correctly.
14. Ensure commands register correctly.
15. Ensure owner pickup protection actually works.
16. Ensure TNT orbital attacks actually work on a dedicated server.
17. Ensure client/server logic is correctly separated.
18. Ensure no client-only classes are accidentally loaded on the dedicated server.
19. Ensure the mod does not depend on commands being run manually for basic registration.
20. Build the project and verify compilation.
21. If you have a build tool/environment, actually run Gradle build and fix every compilation error before giving me the final project.
22. The final output must be usable to create a .jar for my Fabric 1.21.1 server.
MOST IMPORTANT:
I do NOT want another explanation of how I could build it.
I want YOU to build the complete project from these requirements.
Do not stop at the main Java class.
Do not give pseudocode.
Do not omit resource files.
Do not tell me to "fill in the rest."
Produce the finished Custom Arsenal Fabric 1.21.1 mod project.
KodariAug 28 at 7:57 pm 1
CustomArsenal
Custom Arsenal is a Fabric mod for Minecraft 1.21.1 that adds six owner-bound Netherite-tier weapons and four armor pieces. Features include Riven (wither sword), Shatter (weakness axe), Skewer (reach spear with lunge), Ruin (AOE mace), Gaze Nuke (48-TNT orbital barrage), and Gaze Stab (20-TNT column strike). Includes persistent claim system, pickup protection, and admin commands.
Set up the Fabric 1.21.1 Gradle project and metadata.
Implement registrations, ownership, persistent claims, commands, pickup protection, weapons, and armor.
Add all required client-independent resources, models, translations, and placeholder textures.
Review the generated project for API consistency and build-readiness.
[Generation stopped]
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code