Description
Description
CustomNPC TACZ Gun Compatibility is a bridge addon between CustomNPCs and Timeless & Classics Guns: Zero (TACZ). It makes CNPC NPCs use TACZ firearms like real combatants instead of ignoring guns or behaving like ordinary mobs.
The addon fixes NPC target acquisition so that the NPC's aggro range is actually respected when searching for TACZ gun targets. It gives NPCs automatic draw, aim and fire behavior, maps the NPC Ranged settings to TACZ accuracy, damage and fire modes, supplies infinite ammunition while preserving TACZ's real reload, respects extended magazine attachments, and enables TACZ muzzle flash for NPC shots with automatic suppressor support.
This is a beta build. Please back up your world, config and modpack before installing.
Requirements
- Minecraft 1.20.1
- Forge 47+
- TACZ
tacz-1.20.1-1.1.8-hotfixor newer [TaCZ] Timeless and Classics Zero Guns - Minecraft Mods - CurseForge - CustomNPCs Unofficial (1.20.1 GBPort) or official CustomNPCs CustomNPCs-Unofficial - Minecraft Mods - CurseForge
- CNPC Curios API CNPC Curios API - Minecraft Mods - CurseForge
- CNPC-plus-Fix CNPC-plus-Fix - Minecraft Mods - CurseForge
Installation
- Back up your world, config and modpack.
- Install Forge 1.20.1.
- Install all required mods listed above.
- Put
CustomNPC-TACZ-Gun-Compatibility-1.0-Beta.jarinto themodsfolder. - Remove any older versions of the same addon to avoid duplicate mod IDs.
- Start the game completely.
Weapon Slot Setup
- Open the NPC inventory.
- Put the TACZ gun in the NPC's main weapon slot.
- Put any item in the NPC's projectile/ammo slot (the slot normally used for CNPC ranged projectiles). This addon does not read that slot; it only checks the TACZ gun in the main weapon slot. No real ammunition is needed there.
- Set the NPC's faction or hostility so it has an attack target.
- Set the NPC aggro range and Ranged settings.
- The NPC will draw, aim and fire the TACZ gun automatically.
Note: the gun must be in the main weapon slot. TACZ guns in other weapon slots are not used by this addon.
Features
- NPC aggro range is respected when acquiring TACZ gun targets.
- NPCs automatically draw, aim and fire TACZ guns at their attack target.
- CNPC's built-in ranged projectile attack is suppressed while a TACZ gun is held, preventing double shots.
- Accuracy follows the NPC Ranged Accuracy (%) setting, using CNPC's original spread formula.
- Damage follows the NPC Ranged Damage setting instead of TACZ bullet damage.
- TACZ headshot damage multiplier is disabled for NPC shots, keeping damage at the configured value.
- Fire mode is controlled by the NPC Ranged settings: Burst Count 1 for continuous fire, Burst Count greater than 1 for burst fire.
- Infinite ammunition is supplied through a virtual ammo handler, but NPCs still use TACZ's real reload state, animation, sound and timing.
- Magazine capacity follows TACZ extended magazine attachments.
- Muzzle flash is rendered for NPC shots; suppressors automatically remove the flash.
- Works with the included CNPC aggro/follow-range fix; the addon also enforces the aggro range at runtime.
NPC Ranged Settings Reference
Accuracy (%)
Accuracy controls TACZ shot spread for NPCs. The addon uses the same formula as CNPC's projectile accuracy:
spread = 20 - floor(Accuracy / 5) degrees
Examples:
- 100% → 0° (perfect aim; TACZ base inaccuracy still applies)
- 90% → 2°
- 75% → 5°
- 50% → 10°
- 25% → 15°
- 1% → 20°
Each shot receives a random horizontal and vertical offset inside that cone. Lower the value if the NPC is too accurate; raise it if the NPC misses too much.
Damage
NPC-fired TACZ bullets use the NPC Ranged Damage value. TACZ's own bullet damage and headshot multiplier are overridden for NPC shooters, so the configured value is the base damage. Armor and normal damage handling still apply.
Burst Count, Burst Rate and Delay
Burst Count = 1: continuous fire. The NPC fires at the gun's RPM while it has a target and line of sight.Burst Count > 1: burst fire. The NPC fires exactly that many shots per volley.Burst Rate: ticks between shots inside one burst. 20 ticks = 1 second. Minimum 1.Delay Min/Max: random pause after each volley or single shot. 20 ticks = 1 second. Minimum 1.- The actual interval is the larger of the configured delay and the gun's own RPM/bolt-action time.
Recommended presets:
- Full-auto rifle: Burst Count 1, Delay Min/Max 1/1.
- Burst rifle: Burst Count 3, Burst Rate 2, Delay Min/Max 10/20.
- Sniper rifle (Kar98k): Burst Count 1, Delay Min/Max 40/60 or higher; bolt-action time is added.
- Pistol: Burst Count 1, Delay Min/Max 4/10.
- LMG: Burst Count 100, Burst Rate 1, Delay Min/Max 1/1.
If changing Delay seems to have no effect, the gun's own RPM or bolt-action time is longer than the configured value. Increase Delay above that interval.
Target Range
Target acquisition uses the NPC aggro range. If the NPC does not react at long range, increase aggro. Very high values can increase pathfinding cost and cause lag on large servers.
Ammo and Reload
- NPCs have infinite ammunition through a virtual ammo handler.
- NPCs still perform TACZ's real reload: reload state, animation, sound and timing.
- Extended magazine attachments are respected. Example: an AKM with a base 30-round magazine and an Ammo Capacity II attachment reloads to 37 rounds.
- If TACZ cannot start a reload for a special gun, the addon falls back to refilling the magazine after about 5 seconds.
- Guns that use inventory-fed ammunition also work through the virtual ammo handler.
Muzzle Flash and Suppressors
- NPC shots render TACZ's muzzle flash using the gun pack's
muzzle_flashdisplay definition. - Install a suppressor (a muzzle attachment with the silence modifier) and the flash is automatically removed.
- Only TACZ guns in the main weapon slot are supported.
- If a gun pack does not define a muzzle flash, neither players nor NPCs will show one.
- Muzzle flash is visual only and does not change damage or accuracy.
CNPC Ranged AI
While an NPC is holding a TACZ gun, CNPC's own EntityAIRangedAttack goal is suppressed. This prevents the NPC from firing its built-in projectile system in addition to the TACZ gun. TACZ shooting is handled by this addon.
TACZ Animation Additions and FreshMoves
- Tacz-Animation-Additions is a player animation mod. Its PlayerAnimator full-body animations require
AbstractClientPlayerand are not ported to CNPC NPCs by this addon. - FreshMoves is an OptiFine player CEM resource pack and applies to players, not to CNPC NPCs.
- Muzzle flash is supported for NPCs independently of those animation packs.
Troubleshooting
NPC does not shoot
- Is the TACZ gun in the NPC's main weapon slot?
- Does the NPC have a valid target? Check faction, hostility and attack settings.
- Is aggro range greater than 0 and large enough?
- Is the NPC Ranged Damage greater than 0?
- Are CustomNPCs, TACZ and all required mods installed and loaded?
NPC fires too fast or too slow
- The gun's own RPM and bolt-action time are always a lower bound.
- To slow a sniper or pistol, set Delay Min/Max higher than the gun's RPM interval.
- To get continuous fire, set Burst Count 1 and Delay Min/Max 1/1.
- To get burst fire, set Burst Count greater than 1.
No bullets or no damage
- Test with a default TACZ gun.
- Check that the TACZ version is compatible.
- Check the game log for TACZ errors.
- Make sure another mod is not cancelling TACZ's gun damage event.
No muzzle flash
- Does the gun pack define a muzzle flash?
- Is a suppressor installed?
- Is the gun in the main weapon slot?
- Shader shadow passes do not render the flash.
Compatibility Notes
- Tested with TACZ 1.1.8-hotfix, CustomNPCs 1.20.1 GBPort/Unofficial, CNPC Curios API and CNPC-plus-Fix.
- The addon uses TACZ's
EntityHurtByGunEvent.Preto apply NPC damage. Other mods that modify the same event may conflict. - Very high aggro values increase NPC pathfinding and can affect performance.
- This is a beta build. Keep backups of your world, config and mods.
