跳到正文

Dynasty Guard Villager Fix

作者:daemaris

server side mod who can fix your arc's guard villager mod

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

# Dynasty Guard Fix

**Stops the Guard Villagers crash when a guard fires a bow.**

If your Fabric 1.21.1 server crashes with `java.lang.IllegalArgumentException: Invalid weapon firing an arrow` while ticking a `guardvillagers:guard` entity, this small server-side mod is for you.

## The problem

When a guard fires a bow, Guard Villagers clears the item the guard is using, then passes that same empty item to Minecraft as the arrow’s weapon. Minecraft 1.21 rejects arrows fired from an empty weapon. The error happens during the entity tick, so the whole server goes down.

Guards only use swords and crossbows by default, so the bug can stay hidden for a long time. It usually appears once guards receive bows, for example through a datapack, an equipment mod, or a player.

## The fix

Just before an arrow is created, this mod checks the weapon. If it is empty, the item in the shooter’s main hand is used instead. If that hand is empty too, the arrow is created with no weapon, which Minecraft accepts.

Valid weapons are never changed, so the mod only acts in a case that would otherwise crash the server. Guards keep their bows and shoot normally.

The fix is applied to Minecraft’s arrow creation code rather than to Guard Villagers itself. It should therefore also stop the same crash if another mod makes the same mistake.

## Features

– No more `Invalid weapon firing an arrow` crash
– Guards keep their bows, with no commands or item replacement needed
– Server-side only: players don’t need to install anything
– No configuration
– No Fabric API required
– One small mixin

## Installation

1. Put the jar in your server’s `mods` folder.
2. Restart the server.

The first time a shot is corrected, the console shows this message once:

`Tir à l’arme vide corrigé (premier cas : …). Le serveur n’a pas planté.`

## Compatibility

– Minecraft 1.21.1
– Fabric Loader 0.19.3 or newer
– Java 21
– The crash was reported with Guard Villagers 2.1.2-1.21.1

## Known limitation

Bows held by guards don’t lose durability. Guard Villagers applies the wear to the same empty item, so this doesn’t affect server stability.

## FAQ

**Do players need this mod?**
No. It only runs on the server and is ignored on the client.

**Do I still need to remove bows from my guards?**
No. That’s the point of this mod.

**Does this replace Guard Villagers?**
No. Keep Guard Villagers installed. This mod only prevents the crash.

常见问题

Dynasty Guard Villager Fix 支持哪些 Minecraft 版本?

Dynasty Guard Villager Fix 支持 Minecraft Java 版 1.21.1,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

Dynasty Guard Villager Fix 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

daemaris 的其他作品

查看全部 →