
CombatGunSSS
Adds 45 unique guns to Minecraft, each with custom damage, recoil, fire rate, and reload mechanics, enhancing combat with balanced gameplay, multiple weapon types, and flexible customization for varied playstyles
- Загрузки
- 2K
- Подписчики
- 6
- Обновлён
- 18 июля 2026 г.
- Лицензия
- Apache-2.0
Опубликован 23 марта 2026 г.
🔫 CombatGunSSS
CombatGunSSS is a high-performance, feature-rich Minecraft gun plugin designed for modern servers (1.21+). It brings a tactical, realistic combat experience with 46 uniquely configured weapons (40 firearms + 6 melee), advanced crafting mechanics, optimized hitscan technology, a full custom events API, and a growing ecosystem of plugin integrations.
🌟 Key Features
- 🎯 Tactical Combat: Realistic hitscan mechanics with accurate recoil, bullet spread, and headshot multipliers.
- ⚔️ Melee System: Left-click melee combat with range check, knockback, and separate cooldown system.
- 🛡️ Advanced Penetration: Projectiles can pass through "soft" blocks and multiple entities based on individual gun stats.
- 🩸 Progressive Damage: Distance-based Damage Falloff and configurable Knockback intensities.
- 🛠️ Two-Tier Crafting System:
- Vanilla Workbench: Craft basic components with official Recipe Book support.
- Mechanical Crafting Table: A custom 21-slot industrial GUI for assembling advanced firearms.
- 📂 Interactive Recipe Browser: Built-in visual guide inside the Mechanical Crafting Table — no commands needed! Browse by Gun, Melee, or Ammo category tabs to quickly find what you want to craft.
- 📦 46 Built-in Weapons: 40 ranged guns + 6 melee weapons with burst-fire, shotgun pellets, and melee logic.
- 📉 Durability System: Weapons can have limited usage and require repairs (fully configurable).
- 📊 Persistent HUD: Real-time action bar showing gun name (rarity-colored), visual ammo bar, current/max ammo, and reserve count.
- 🔄 Auto-Reload: Automatically reloads after firing the last round (toggleable).
- 🗺️ WorldGuard Integration: Block gun use inside protected regions with a custom
gun-shootingflag. - 💰 Vault Shop: Players purchase weapons via
/gun buy <id>using server economy. - 📋 PlaceholderAPI: 8 real-time placeholders for scoreboards, HUDs, and TAB plugins.
- 🎯 ADS (Aim Down Sights): Per-gun aim-down-sights system. Shift+Right-click to toggle — reduces spread and applies movement penalty.
- 🩸 Bleeding: Optional damage-over-time on bullet hit. Cured by holding a bandage and pressing
[F]. - 🎒 Ammo Pouch: Compressed ammo bag. Shift+Right-click to unpack into inventory. Give via
/gun givepouch. - 🌐 Multi-Language (i18n): All messages live in
lang/en.ymlorlang/vi.yml. Add your own translation file. - 🛡️ Anti-Cheat: Automatic exemptions for Vulcan and Matrix to prevent recoil false-positives.
- 🔌 Developer API: Full custom events —
GunShootEvent,GunReloadEvent,GunHitEvent,GunHeadshotEvent. - 🤝 Friendly Fire Control: Toggle friendly fire on/off with scoreboard team or permission-group detection.
- 🎨 Toggleable Effects: Every particle and sound effect can be individually enabled/disabled. Includes a master
sound_volumecontrol. - 💀 Custom Kill Messages: Death messages show killer name, weapon name (colored by rarity), and headshot indicator.
🎮 Player Controls
| Action | Control |
|---|---|
| Shoot | Right Click |
| Reload | Swap Hand Key [F] |
| Melee Attack | Left Click |
| Buy a weapon | /gun buy <id> |
| Crafting | Right Click on Mechanical Crafting Table |
🔫 Weapon Categories
Ranged Weapons (39)
- Assault Rifles: AK47, M4A1, SCAR, AUG, FAMAS, G36, Groza, AN94, M14, ParaFAL, XM8, Kingfisher
- SMGs: MP5, P90, Vector, Bizon, UMP, Thompson, MAC-10, MP40, VSS, CG15
- Snipers: AWM, M24, Kar98k, M82B, M107, VSK94
- Shotguns: M1014, SPAS-12, MAG-7, M1887, M590, Trogon
- Pistols: Desert Eagle, G18, USP, M1917, M1873, M500
Melee Weapons (6)
- Bat: Common, fast swing
- Knife: Common, highest attack speed
- Pan: Rare, defensive knockback
- Parang: Rare, balanced damage/speed
- Katana: Epic, high damage
- Scythe: Legendary, maximum damage
🔫 Technical Weapon Stats
Every weapon in CombatGunSSS features a deep set of configurable properties:
- Damage Falloff: Define exactly at what block distance damage begins to drop (
damage_falloff_start) and the minimum damage floor (min_damage_multiplier). - Recoil & Spread: Independent Pitch (vertical) and Yaw (horizontal) kick per shot, plus Movement Spread penalties while moving or jumping.
- Burst Fire: Configure weapons to fire multiple rounds per trigger pull (
burst_count) with custom delays. - Shotgun Logic: Support for multiple projectiles per shot (
projectiles_per_shot) with per-pellet damage calculation. - Durability: Set a maximum usage limit (
max_durability). Weapons will break and become unusable until repaired. - Penetration: Define how many blocks (
block_penetration) or entities (entity_penetration) a single bullet can pass through. - Melee Range: Maximum attack distance for melee weapons (default: 4 blocks).
- Knockback: Push strength for both ranged and melee weapons.
📁 Folder Structure
plugins/CombatGunSSS/
├── config.yml # Main configuration
├── guns/ # Ranged weapon configs (40 built-in + custom)
│ ├── ak47.yml
│ ├── m4a1.yml
│ └── ...
├── melees/ # Melee weapon configs (6 built-in + custom)
│ ├── katana.yml
│ ├── knife.yml
│ └── ...
└── README.md
Custom Weapons: Create your own YAML files in guns/ or melees/ folders and run /gun reload.
⚒️ Crafting Mechanics
1. Components (The Basics)
Craft raw materials like Steel Ingots, Gun Barrels, and Springs at a standard Crafting Table. These recipes are automatically unlocked in your Vanilla Recipe Book.
2. Assembly (The Advanced)
Place your components into the Mechanical Crafting Table.
- Non-grid-based: Just throw the ingredients into the 21-slot input area.
- Visual Preview: The output slot shows your gun stats before you build it.
- Recipe Guide: Click the Glowing Book icon in the station to browse all weapon requirements.
📊 Action Bar HUD
While holding any ranged weapon, CombatGunSSS displays a persistent HUD on your action bar:
🔫 AK47 ▐████████████░░░░▌ 22 / 30 • 90
- Gun name is colored by rarity: white (common) → aqua (rare) → light purple (epic) → gold (legendary).
- Visual bar transitions green → gold (≤25%) → red (≤10%) as ammo depletes.
- Reserve count turns red when you have no backup ammo left.
- The HUD automatically yields to the reload progress bar during active reloads.
combatgun:
hud:
enabled: true
update_interval_ticks: 5
🎯 ADS — Aim Down Sights
Enable ADS per gun in its YAML config:
ads:
enabled: true
spread_multiplier: 0.35 # 65% tighter accuracy while ADS
movement_penalty: 0.6 # movement speed while ADS active
Control: Shift+Right-click to toggle ADS on/off. Action bar shows 🎯 ADS [spread ×0.35].
ADS exits automatically when you switch items, teleport, or die. Scopeable sniper rifles use the traditional sneak-to-scope mechanic instead of ADS.
🩸 Bleeding
An optional damage-over-time system. When enabled, bullets hitting players have a configurable chance to cause bleeding.
combatgun:
bleeding:
enabled: true
chance: 0.15
damage_per_second: 1.0
duration_seconds: 10
cure_item: bandage
Hold a bandage (crafting component) and press [F] to cure. Bleeding stops automatically on death.
🎒 Ammo Pouch
A compressed ammo container that stores hundreds of rounds in a single slot.
/gun givepouch ar_ammo 300 PlayerName
Shift+Right-click to unpack all rounds into your inventory. Surplus rounds are left if the inventory is full.
🌐 Multi-Language
Set the active language in config.yml:
combatgun:
language: vi # en | vi | (any lang/xx.yml)
Bundled: English (en) and Tiếng Việt (vi). Add a custom translation by placing lang/xx.yml in the plugin data folder and running /gun reload.
🔌 Plugin Integrations
PlaceholderAPI
8 real-time placeholders for use in scoreboards, TAB, AdvancedHud, and similar plugins:
| Placeholder | Example | Description |
|---|---|---|
%combatgun_gun_name% |
AK47 |
Display name of held gun |
%combatgun_gun_id% |
ak47 |
Internal ID of held gun |
%combatgun_gun_rarity% |
epic |
Rarity of held gun |
%combatgun_ammo% |
24 |
Current magazine ammo |
%combatgun_ammo_max% |
30 |
Magazine capacity |
%combatgun_ammo_reserve% |
90 |
Reserve ammo in inventory |
%combatgun_is_reloading% |
true |
Whether player is reloading |
%combatgun_is_gun% |
true |
Whether held item is a gun |
Vault Shop
Enable the shop in config.yml, set prices per gun, then players can buy weapons in-game:
combatgun:
shop:
enabled: true
currency_symbol: "$"
guns:
ak47: 700.0
awm: 2500.0
knife: 100.0
/gun buy ak47 # purchase for configured price
/gun buy ak47 free # admin free-give (requires combatgun.admin)
WorldGuard
The custom flag gun-shooting is automatically registered when WorldGuard is present:
/rg flag <region> gun-shooting deny # block all guns in region
/rg flag <region> gun-shooting allow # explicitly allow
/rg flag <region> gun-shooting -g # remove flag (inherit parent)
Falls back to WorldGuard's built-in PVP flag if gun-shooting is not set on a region.
Anti-Cheat (Vulcan / Matrix)
Auto-detected. When present, players are exempted from motion checks for anticheat.exempt_ticks ticks after each shot to prevent recoil from triggering false positives.
combatgun:
anticheat:
exempt_ticks: 3
📜 Commands & Permissions
| Command | Description | Permission |
|---|---|---|
/gun statsreset <player> |
Reset a specific player's stats | combatgun.admin |
/gun seasonreset confirm |
Wipe ALL player stats (season reset) | combatgun.admin |
/gun give <id> [player] |
Give a specific weapon | combatgun.admin |
/gun giveammo <id> [amt] [player] |
Give custom ammunition | combatgun.admin |
/gun givepart <id> [amt] [player] |
Give crafting components | combatgun.admin |
/gun station [player] |
Give the Mechanical Crafting Table | combatgun.admin |
/gun book [player] |
Give the Recipe Guide Book | combatgun.admin |
/gun recipe <id> |
Show the full crafting chain in chat | combatgun.admin |
/gun list [category] |
View all loaded weapons | combatgun.admin |
/gun inspect [player] |
View deep stats of the held weapon | combatgun.admin |
/gun reload |
Reload all configurations | combatgun.admin |
/gun buy <id> |
Purchase a weapon (requires Vault) | combatgun.use |
/gun givepouch <ammo_id> <amount> [player] |
Give an ammo pouch | combatgun.admin |
Player Permissions
combatgun.use— Allows shooting and using guns (default:true)combatgun.use.<gun_id>— Per-gun permission node (e.g.combatgun.use.awm)
🔧 Configuration Examples
Ranged Weapon (AK47)
name: AK47
category: assault_rifles
ammo_type: ar_ammo
damage: 12
fire_rate: 10.0
magazine_size: 30
reload_time: 2.6
headshot_multiplier: 1.8
damage_falloff_start: 35.0
min_damage_multiplier: 0.5
range: 72.0
block_penetration: 0.8
entity_penetration: 0
recoil:
pitch: 1.45
yaw: 0.42
spread: 0.24
recovery: 0.80
rarity: rare
custom_model_data: 1001
sound: ENTITY_FIREWORK_ROCKET_BLAST
recipe:
station: mechanical_crafting_table
ingredients:
steel_ingot: 6
gun_barrel: 1
spring: 2
hardwood: 3
Melee Weapon (Katana)
name: Katana
category: melee
ammo_type: none
rarity: epic
damage: 10
fire_rate: 1.35
range: 4.0
knockback: 0.3
sound: ENTITY_PLAYER_ATTACK_CRIT
custom_model_data: 26002
recipe:
station: mechanical_crafting_table
ingredients:
steel_ingot: 10
carbon_fiber: 2
leather_strip: 3
blade_core: 1
🔌 Developer API
Custom Events
| Event | Cancellable | When it fires |
|---|---|---|
GunShootEvent |
✅ | Before each shot — cancel or set damage multiplier |
GunReloadEvent |
✅ | When a player starts reloading |
GunHitEvent |
❌ | After damage is applied — full damage pipeline |
GunHeadshotEvent |
❌ | When a shot lands in the head zone |
AttachmentApplyEvent |
✅ | Before an attachment is fitted to a gun |
AttachmentRemoveEvent |
✅ | Before an attachment is removed from a gun |
@EventHandler
public void onShoot(GunShootEvent event) {
if (isInsideArena(event.getShooter()))
event.setDamageMultiplier(2.0);
}
@EventHandler
public void onReload(GunReloadEvent event) {
if (isCapturingObjective(event.getPlayer()))
event.setCancelled(true);
}
@EventHandler
public void onHit(GunHitEvent event) {
// base damage, final damage, headshot flag, distance
plugin.getStats().record(
event.getShooter(), event.getGun().getId(),
event.getFinalDamage(), event.isHeadshot(), event.getDistance());
}
@EventHandler
public void onHeadshot(GunHeadshotEvent event) {
event.getShooter().giveExp(5);
}
API Instance
CombatGunAPI api = CombatGunAPI.getInstance();
// Query guns
GunData gun = api.getGun("ak47");
Collection<GunData> all = api.getAllGuns();
// Create items
ItemStack gunItem = api.createGunItem("ak47");
ItemStack ammo = api.createAmmoItem("ar_ammo", 30);
// Check items
boolean isGun = api.isGun(item);
String gunId = api.getGunId(item);
// Player state
boolean isReloading = api.isReloading(player.getUniqueId());
// Hook state
boolean shopEnabled = plugin.getHookManager().getVaultHook().isEnabled();
boolean wgActive = plugin.getHookManager().getWorldGuardHook().isAvailable();
🚀 Installation
- Download the
CombatGunSSS-2.3.0.jar. - Drop it into your server's
pluginsfolder. - (Optional) Install any soft-depend plugins you want: PlaceholderAPI, Vault, WorldGuard, Vulcan, Matrix.
- Restart the server to generate default configurations.
- (Optional) Add a Resource Pack to see 3D gun models.
Requirements
- Server: Paper/Spigot 1.21+
- Java: 21 or higher
- Required dependencies: None (standalone plugin)
- Optional dependencies: PlaceholderAPI, Vault + economy plugin, WorldGuard, Vulcan, Matrix
📋 Changelog
See CHANGELOG.md for the full version history.
2.3.0 — Critical exploit + melee combat fix
- Fixed ammo/component items (built on vanilla materials like gold/iron nuggets) being craftable or smeltable into real vanilla resources without a resource pack — closed both the crafting-grid and furnace-smelting paths
- Fixed melee weapons (katana, knife, pan, etc.) dealing no damage and not affecting the target at all — hit sound played but the attack silently did nothing due to an event-recursion bug
2.2.0 — Permission-gate fix release + Recipe Browser categories
- Fixed
/guncommand tree blocking every player-facing subcommand (buy,attach,detach,attachments,stats,leaderboard,recipe) for non-admins — bothonCommand()andonTabComplete()were hard-gated behindcombatgun.admin - Fixed
VaultHook.buyGun()silently discarding a purchased weapon when the buyer's inventory was full - Added Gun / Melee / Ammo category tabs to the Recipe Browser so players can find craftable items faster
2.1.0 — Bug-fix release: 8 bugs fixed
- Fixed
StatsManager.flushBuffer()race condition — kill data silently lost under concurrent load - Fixed
ThrowableManagertasks not cancelled on plugin disable —IllegalPluginAccessExceptionon every disable - Fixed
clearAds()removing scope slowness incorrectly - Fixed all
ReloadManagermessages bypassing i18n (hardcoded English shown toviservers) - Fixed
BleedingManagerandThrowableManagerusingMath.random()instead ofThreadLocalRandom - Fixed
AttachmentManagerandGunListenerduplicate import statements - Fixed
getRecentDamage()exposing mutable map reference; added safegetDamageRecord()lookup
2.0.6 — Bug-fix release: 4 bugs fixed
- Fixed friendly-fire scoreboard team detection using player scoreboard instead of main scoreboard — could allow friendly-fire bypass
- Fixed
recentDamagememory leak: entries now removed on player quit and death events - Fixed shared
static Randomcontention: replaced withThreadLocalRandom.current()(per-thread, no lock, better entropy) - Fixed async SQLite connection safety:
incrementGunKill()andgetGunKills()now synchronized alongsideflushBuffer()
2.0.5 — Developer API & architecture release: 4 new additions, 1 improvement
- New
AttachmentApplyEventandAttachmentRemoveEvent(cancellable) — fired on/gun attachand/gun detach - New
DamageCalculatorutility class — centralises all damage math extracted fromGunListener(headshots, falloff, spread, pellets) - New
kills_by_gun_detailSQLite table (schema v3) — per-kill log with timestamp, weapon, headshot flag - New commands:
/gun statsreset <player>and/gun seasonreset confirm GunListenerGod Class partially refactored — 4 methods delegate toDamageCalculator
2.0.4 — Stability & performance release: 2 bug-fixes, 3 improvements
- Fixed thread-safety data race in
StatsManagerstat buffer (ConcurrentHashMap) - Fixed silent loading of invalid gun configs (YAML validation with clear per-field errors)
StatsManagerleaderboard query optimized with akills DESCindex (schema migration v2)- Shop price reads now cached in memory; invalidated on
/gun reload - Config version detection warns admins when
config.ymlis outdated after an update
2.0.3 — Bug-fix release: 7 bugs fixed
- Ammo Pouch no longer loses items when the inventory is full
- Reload task CPU usage reduced by 50% (changed from 1 tick to 2 tick interval)
isHeadshot()now works accurately when the player is crouchingcraftFromStation()properly rolls back ingredients if crafting failsBleedingManagernow uses wall-clock time for accurate damage even during server lagapplyRecoil()is now fully null-safe- Fixed race condition in
onItemHeldChange
🔍 Troubleshooting
Friendly fire still occurring despite being disabled
- Fixed in 2.0.6 — team detection now uses the main scoreboard instead of each player's personal view
- Ensure teams are set up with
/team add <name>and players added with/team join <name> <player> - Test with
combatgun.team_provider: scoreboardinconfig.yml
Guns not working / can't shoot
- Check
combatgun.usepermission is granted to players - Make sure the world is not blacklisted in
config.yml - If using WorldGuard, check if the region has
gun-shooting deny - Try
/gun give ak47and test in a clean area - Use Paper — Spigot is not supported
Ammo not found / can't reload
- Make sure you have the correct ammo type in your inventory (e.g. AR ammo for assault rifles)
- Craft ammo at a Vanilla Crafting Table or Mechanical Crafting Table
- Check
ammo_typein the gun's YAML matches a defined ammo type inconfig.yml - Run
/gun reloadafter editing configs
Recipes not showing in crafting table
- Run
/gun reloadto re-register vanilla recipes - Give yourself the Recipe Guide Book:
/gun book - Ensure the ingredient IDs in the gun YAML match those defined in
config.yml
Console warning: "config.yml is OUTDATED"
- This warning appears when your
config.ymlhas a lowerconfig-versionthan the plugin expects. - Back up your current
config.yml, delete it, and restart the server to regenerate a fresh one. - Then manually copy over your custom settings (world lists, shop prices, effects, etc.) from the backup.
- The plugin loads normally even with an outdated config — default values are used for missing keys.
Gun config not loading / "config validation failed" warning
- Added in 2.0.4 — guns with invalid configs now log a clear per-field error instead of loading silently.
- Check the listed fields:
damage,fire_rate,magazine_size,reload_timemust all be greater than 0. burst_countmust be at least 1.namecannot be blank.- Fix the values in the gun's YAML and run
/gun reload.
Leaderboard (`/gun leaderboard`) is slow on large servers
- Fixed in 2.0.4 — a
kills DESCindex is now created automatically on the SQLite database. - The migration runs once on first startup of 2.0.4. If you still experience slowness, ensure the server was fully restarted (not
/reload).
Ammo Pouch destroying items when inventory is full
- Fixed in 2.0.3 — update the plugin
- Partial unpacks now save remaining ammo back into the pouch instead of destroying it
Reload taking wrong amount of time / inconsistent
- Fixed in 2.0.3 — reload task now runs every 2 ticks instead of 1 (50% less CPU, same reload duration)
- If still wrong, check
reload_timein the gun's YAML (in seconds)
Headshots not registering correctly
- Fixed in 2.0.3 — crouching player hitbox now calculated correctly
- Headshot detection uses the top 20% of the entity hitbox, adjusted for crouch state
Bleeding damage lower than configured
- Fixed in 2.0.3 —
BleedingManagernow uses wall-clock time instead of tick counting - Damage is now accurate even under server lag
Plugin crashes on startup
- Fixed in 2.0.1 — startup errors are now isolated per manager
- Check console for
[CombatGunSSS]error lines indicating which manager failed - Common cause: corrupted
config.ymlor invalid gun YAML syntax - Fix the config, then restart (do not use
/reload)
NullPointerException when shooting
- Fixed in 2.0.2 — lazy HudManager access prevents NPE at startup
- If persisting: check that
HookManageris not null in the stack trace and update to latest version
Anti-cheat flagging recoil movement
- Ensure Vulcan or Matrix is listed in
softdepend(already done automatically) - Increase
combatgun.anticheat.exempt_ticksinconfig.yml(default:3) - The plugin auto-detects and registers exemptions via reflection — no API jar needed
PlaceholderAPI placeholders showing as raw text
- Install PlaceholderAPI and run
/papi reload - Ensure PlaceholderAPI is loaded before CombatGunSSS (restart, not
/reload) - Test with
/papi parse me %combatgun_gun_name%
Vault shop not working
- Make sure an economy plugin (EssentialsX, CMI, etc.) is installed alongside Vault
- Set
combatgun.shop.enabled: trueinconfig.yml - Confirm the gun ID exists in
combatgun.shop.gunsprice list - Use
/gun buy <id> free(admin) to test without balance requirement
/reload breaks the plugin
- Never use
/reload— always do a full server restart - Use
/gun reloadto hot-reload gun configs, language files, and settings without restarting
Custom gun YAML not loading
- Place the file inside
plugins/CombatGunSSS/guns/(ranged) ormelees/(melee) - Run
/gun reload— check console for warnings about your file - Ensure required fields are present:
name,category,ammo_type,damage,magazine_size - YAML is whitespace-sensitive — use a validator like yaml.org/start.html
❓ FAQ
Does this work on Spigot?
No — CombatGunSSS requires Paper 1.21+. Spigot lacks several API features used internally.
Can I add my own guns?
Yes. Create a new .yml file in plugins/CombatGunSSS/guns/ following the same format as the built-in weapon files, then run /gun reload.
Can I disable specific guns?
Simply delete or remove the gun's YAML file from the guns/ folder and run /gun reload. Players holding that gun will keep the item but it won't function.
Does it support multiple worlds?
Yes. Configure a world whitelist or blacklist under combatgun.worlds in config.yml.
Is it laggy on large servers?
CombatGunSSS uses hitscan (ray-trace, not projectile entities), so it is significantly lighter than projectile-based gun plugins. Heavy effects like bullet trails can be toggled off in config.yml under combatgun.effects.
Can I disable the crafting system?
Yes — simply don't give players the Mechanical Crafting Table or Recipe Book. Use /gun give for admin distribution. Vanilla workbench recipes can also be disabled per-item.
Do I need a Resource Pack?
No. The plugin works without a resource pack. However, each gun has a custom_model_data value pre-configured for you to link 3D models if you have a pack.
Can I disable bleeding or the Ammo Pouch?
Yes. Set combatgun.bleeding.enabled: false or combatgun.ammo_pouch.enabled: false in config.yml.
Does it support ZombieApocalypseSSS?
Yes — CombatGunSSS is the recommended gun companion for ZombieApocalypseSSS. Guns deal full damage to all zombie types and trigger the noise / aggro system automatically.
Can other plugins listen to gun events?
Yes. Four custom events are exposed via the API: GunShootEvent (cancellable), GunReloadEvent (cancellable), GunHitEvent, and GunHeadshotEvent. See the Developer API section.
How do I give guns without the shop?
Use /gun give <id> [player] (requires combatgun.admin). Example: /gun give awm Steve.
Developed with ❤️ by Duong2012G.
[!NOTE] This plugin is built on the Paper/Spigot 1.21 API and requires Java 21 or higher.
[!TIP] For support and updates, check the repository or contact the developer.
Ченджлог
2.3.0Релиз1.21.9, 1.21.10, 1.21.11 · 18 июля 2026 г.
[2.3.0] - 2026-07-18
Fixed
🔴 CustomItemManager — Ammo/component items craftable into real vanilla resources without a resource pack (Critical / Economy exploit)
- Root cause: Ammo and component items are built on top of vanilla
Materials purely so a resource pack has something to visually re-skin — e.g.ar_ammo=Material.GOLD_NUGGET,smg_ammo(and the fallback case) =Material.IRON_NUGGET,sg_ammo=Material.CLAY_BALL, and ingot-type components =Material.IRON_INGOT. Without a resource pack installed, players see these exactly as plain vanilla nuggets/ingots — and worse, they are those vanilla materials underneath the custom name/lore/model data. The vanilla crafting grid recognised 9ar_ammoitems as 9 realGOLD_NUGGETs and happily crafted them into a realGOLD_INGOT(same forsmg_ammo→ iron ingot, andsg_ammo→ brick via furnace smelting), letting players convert unlimited free ammo into real vanilla resources. - Fix 1: Added
CustomItemManager.isCustomItem(ItemStack)— a generic check for ourcustom_item_typePDC tag, true for any ammo/component/station item regardless of which vanillaMaterialit's built on. - Fix 2:
CraftingListener.onPrepareCraft()now blocks the vanilla crafting-table result (craftingInventory.setResult(null)) whenever the 3×3/2×2 grid contains any of our tagged items and the grid doesn't match one of our own recognised workbench recipes. - Fix 3: New
CraftingListener.onFurnaceSmelt()handler cancelsFurnaceSmeltEvent(covers furnace, blast furnace, and smoker) whenever the item being smelted carries our custom tag — closing the same hole for materials with a vanilla smelting recipe (e.g. clay ball → brick).
🔴 GunListener.onMeleeAttack() — Melee weapons play the hit sound but deal no damage and don't affect the target (Critical)
- Root cause:
onMeleeAttack()cancelled the original swing'sEntityDamageByEntityEventand then calledtarget.damage(gun.getDamage(), player)to apply custom damage manually. That call fires its own freshEntityDamageByEntityEventwith the same damager (the attacking player) and the sameENTITY_ATTACKcause — which re-entersonMeleeAttack()a second time, synchronously, before the outer call returns. On this inner call,ammoManager.tryMeleeAttack()always failed (the cooldown had just been consumed a few lines above in the outer call), so the inner call cancelled its event — which was the event actually carrying the damage. The outer call then continued on to play the hit sound and particles regardless, producing the exact symptom reported: audible hit, zero damage, target completely unaffected. This affected melee weapons only (ranged hitscan damage isn't triggered from a listenedEntityDamageByEntityEvent, so it can't recurse the same way). - Fix: Added a
meleeInProgressreentrancy guard (Set<UUID>). The player's UUID is added immediately before callingtarget.damage(...)and removed in afinallyblock right after. IfonMeleeAttack()re-enters for the same player while their UUID is already in the set, it now returns immediately without touchingevent.setCancelled()— letting the synthetic inner event proceed uncancelled so the damage actually applies.
2.2.0Релиз1.21.9, 1.21.10, 1.21.11 · 18 июля 2026 г.
[2.2.0] - 2026-07-18
Fixed
🔴 GunCommand — Every player-facing subcommand blocked for non-admins (Critical)
- Root cause:
onCommand()gated the entire/guncommand tree behindcombatgun.adminbefore dispatching to any subcommand, andplugin.ymladditionally declaredpermission: combatgun.admindirectly on the command — so Bukkit's own command dispatcher rejected non-admins beforeonCommand()ever ran. This silently broke/gun buy(the Vault shop),/gun attach//gun detach//gun attachments,/gun stats,/gun leaderboard, and/gun recipefor every player withoutcombatgun.admin, even though several of these handlers already contained their owncombatgun.usecheck — a check that could never actually execute. - Fix: Removed the command-level
permission:entry fromplugin.yml.onCommand()now checks a newPLAYER_SUBCOMMANDSset —buy, attach, detach, attachments, stats, leaderboard, recipe, the self-service subcommands that take no target-player argument — againstcombatgun.useORcombatgun.admin. Every other subcommand (give, giveammo, givepart, station, book, givepouch, givethrowable, inspect, reload, statsreset, seasonreset) still requirescombatgun.admin, since each of those can act on an arbitrary target player and is not meant to be self-service.
🔴 GunCommand.onTabComplete() — Same admin-only gate hid tab-completion for regular players (High)
- Root cause: Identical bug to the one above —
onTabComplete()returned an empty list for any sender withoutcombatgun.admin. Even after fixingonCommand(), non-admins would still see zero suggestions when typing/gun. - Fix:
onTabComplete()now mirrors thePLAYER_SUBCOMMANDSpermission split — non-admins withcombatgun.usesee the subcommand names they're allowed to run, and id-completion for/gun recipe <id>(a read-only lookup) is available to them as well. Argument completion for admin-only give/inspect/config subcommands remains gated behindcombatgun.admin.
🟠 VaultHook.buyGun() — Purchased weapon silently lost when inventory is full (Medium)
- Root cause:
player.getInventory().addItem(gunItem)was called without checking its return value.addItem()silently drops anyItemStackthat doesn't fit, so a player with a full inventory was charged the full price but never actually received the gun. - Fix: The leftover
ItemStacks returned byaddItem()are now dropped at the player's feet viadropItemNaturally(), and the player receives an additional chat message letting them know the purchase was dropped rather than lost.
Added
CraftingManager — Recipe Browser split into Gun / Melee / Ammo tabs
- The recipe browser (opened from the Mechanical Crafting Table's book icon) now shows three clickable category tabs in its bottom row instead of one long mixed list, so players can find what they want to craft without scrolling past unrelated items.
- New
CraftingManager.BrowserCategoryenum (GUN,MELEE,AMMO). Guns and melee weapons are both stored underRecipeData.RecipeKind.GUNinternally, so the split is done by checkingGunData.isMelee()rather than changing the existing recipe-kind enum — this avoids touching the exhaustiveswitchonRecipeKindinCustomItemManager. - Each player's last-viewed tab is remembered in-memory (keyed by UUID) so paging with prev/next stays on the same category instead of resetting to Gun; the cache entry is cleared on
PlayerQuitEventto avoid unbounded growth. - A category with no recipes configured shows an explicit "No recipes here" placeholder instead of an empty page.
openRecipeBrowser(Player, int)is preserved for existing call sites and now delegates to a newopenRecipeBrowser(Player, int, BrowserCategory)overload.
2.1.0Релиз1.21.9, 1.21.10, 1.21.11 · 6 июня 2026 г.
[2.1.0] - 2026-06-05
Fixed
🔴 EntityDeathListener — UnsupportedOperationException crash on every gun kill (Critical)
- Root cause: Both
onPlayerDeath()andonEntityDeath()calledgunListener.getRecentDamage().remove(uuid). Sincev2.0.7,getRecentDamage()returnsCollections.unmodifiableMap(recentDamage)— calling.remove()on an unmodifiable map throwsUnsupportedOperationExceptionimmediately. Every player death after being hit by a gun produced a full stack trace in console and kill attribution was completely broken. - Fix: Replaced both
.remove()calls withgunListener.getDamageRecord(uuid), the safe TTL-checked read method thatGunListener's own Javadoc already recommended. Entries are now cleaned up by TTL expiry (5 s) andpruneRecentDamage()on the next shot — consistent with the original design intent.
🔴 AmmoManager — ConcurrentModificationException / HashMap corruption from async pruneStale() (High)
- Root cause:
lastShotandlastMeleeAttackwere plainHashMapinstances.pruneStale()is called fromrunTaskTimerAsynchronously(async thread) whiletryShoot(),extendCooldown(), andclearPlayer()modify the same maps on the main thread. A plainHashMapunder concurrent access is undefined behaviour in Java — it can throwConcurrentModificationExceptionor corrupt internal state silently. - Fix: Changed both fields to
ConcurrentHashMap. All call sites are unchanged;ConcurrentHashMapis a drop-in replacement that serialises per-key access correctly.
🟠 BleedingManager — Bleeding kills bypass the damage pipeline; no kill attribution (High)
- Root cause:
player.setHealth(newHp)bypassesEntityDamageEvententirely. Deaths from bleeding had no kill feed message, the shooter's kill stat was not recorded, the victim's death stat was not recorded, and absorption hearts were not consumed (damage was applied directly to base HP). - Fix 1: Replaced
player.setHealth()withplayer.damage(amount, shooterPlayer)(orplayer.damage(amount)if the shooter is offline).damage()firesEntityDamageByEntityEvent, correctly consuming absorption hearts and triggeringEntityDeathListenerwith a proper damage cause. - Fix 2: Added a
bleedingShooters: Map<UUID, UUID>field to track victim → shooter UUID.tryApply()andapplyBleeding()now accept aPlayer shooterparameter (passed through fromGunListener.applyEntityDamage()).cancelTask()andcancelAll()clean up the shooter map alongside the task map.
🟠 GunListener + ThrowableManager — Citizens NPCs hit by bullets and grenades (Medium)
- Root cause:
isValidTarget()had no Citizens NPC check, allowing hitscan bullets to hit NPCs. Likewise,detonateFrag()iterated all nearbyLivingEntityinstances without filtering NPCs. When an NPC died from a gun,EntityDeathListener.onEntityDeath()broadcast a kill-feed message to all players. - Fix: Added
if (entity.hasMetadata("NPC")) return false;toisValidTarget()andif (e.hasMetadata("NPC")) continue;todetonateFrag(). No Citizens soft-depend needed —hasMetadata("NPC")is a plain Bukkit API call that returnsfalsewhen Citizens is absent.
🟠 GunListener — Citizens NPCs pushed by knockback from guns and melee (Medium)
- Root cause: Both knockback blocks (
applyEntityDamageandonMeleeAttack) calledtarget.setVelocity()on anyLivingEntitywithout checking for NPC metadata. - Fix: Added
!target.hasMetadata("NPC")to both knockback conditions. The NPC metadata check is done before callingsetVelocity()— if Citizens is not installed, this check costs a single map lookup that always returnsfalse.
🟡 ReloadManager — Reload progress bar prefix hardcoded in English (Low)
- Root cause:
buildBar()used the literal string"🔄 Reloading "instead of routing throughLangManager. All other reload messages already usedlang.get(key), making this the only hardcoded English string in the reload system. - Fix: Added
gun.reload_bar_prefixto bothlang/en.yml("🔄 Reloading") andlang/vi.yml("🔄 Đang nạp đạn").buildBar()now callsplugin.getLangManager().get("gun.reload_bar_prefix").
🟡 StatsManager.getTopKillers() — Buffer-only players absent from leaderboard (Low)
- Root cause:
getTopKillers()queried only the SQLiteplayer_statstable. Players who earned kills within the most recent flush window (~5 minutes) existed only in the in-memorybufferand were invisible on the leaderboard. - Fix: After the DB query, the method now iterates
buffer, identifies UUIDs not already present in the result list, and appends them asPlayerStatsentries using the online player's display name. The combined list is then re-sorted and trimmed tolimit.
2.0.7Релиз1.21.9, 1.21.10, 1.21.11 · 22 мая 2026 г.
[2.0.7] - 2026-05-22
Fixed
🔴 StatsManager.flushBuffer() — Kill data silently lost under concurrent load (Critical)
- Root cause: The old flush implementation called
new HashMap<>(buffer)to snapshot the map, then immediately calledbuffer.clear(). The gap between these two statements allowed the main thread to callrecordKill()and insert a new entry viacomputeIfAbsent. That new entry was then deleted bybuffer.clear()— it was neither in the snapshot (inserted after it was taken) nor survived in the buffer (immediately cleared), so it was never written to SQLite. - Fix: Replaced the snapshot-and-clear pattern with a per-key drain loop: each entry is removed from the
ConcurrentHashMapindividually usingremove(key). SinceConcurrentHashMap.remove()is per-key atomic, any new entry inserted by the main thread after its key has already been drained is guaranteed to remain in the map and be picked up by the next flush cycle. No kill data can be lost.
🔴 ThrowableManager — BukkitRunnable tasks not cancelled on plugin disable (Critical)
- Root cause:
onDisable()stopped the HUD task, bleeding tasks, reload tasks, and the SQLite connection — but never cancelled tasks created byThrowableManager. The fuse-timerBukkitRunnableinhandleThrow()and the smoke particle loop indetonateSmoke()continued to execute after the plugin was disabled, throwingIllegalPluginAccessExceptionfor every remaining tick until the tasks expired naturally. - Fix 1: Added a
cancelAll()method toThrowableManagerthat clearsliveProjectilesand cancels all tracked smoke tasks. - Fix 2:
detonateSmoke()now stores the returnedBukkitTaskreference in aConcurrentHashMap<UUID, BukkitTask>keyed by a random UUID. The task removes its own entry when it completes normally.cancelAll()iterates this map and cancels every outstanding task. - Fix 3:
CombatGunSSSPlugin.onDisable()now callsthrowableManager.cancelAll()alongside the other existing cleanup calls.
🔴 GunListener — Duplicate import statement causes compiler warning (Low / Code Quality)
- Root cause:
GunListener.javacontained two identicalimport java.util.concurrent.ThreadLocalRandom;declarations — one was introduced during a merge and never removed. - Fix: Removed the duplicate import. The class compiles cleanly with a single declaration.
🟡 GunListener.clearAds() — ADS exit incorrectly removes scope slowness (Medium)
- Root cause:
clearAds()used the conditionexisting.getAmplifier() <= 5before removing the Slowness effect. This range is too broad:SCOPE_SLOWNESS = 3falls within it. When a player was simultaneously scoped (Slowness level 3 applied byonSneak) and then exited ADS mode,clearAds()removed the Slowness effect entirely — stripping the scope movement penalty and leaving the player able to move at full speed while scoped. - Fix: Changed the condition to
existing.getAmplifier() != SCOPE_SLOWNESS. ADS exit now only removes the Slowness effect when its amplifier level is not the scope level — leaving scope behaviour intact.
🟡 ReloadManager — Hardcoded English strings bypass i18n system (Medium)
- Root cause: Four player-facing messages in
ReloadManagerwere hardcoded English strings instead of routing throughLangManager: "Magazine is already full!", "No<ammo>in inventory.", "Reload failed: no ammo left.", and the entire "✔ Reloaded! [x/y] -z ammo" completion message. Servers configured withlanguage: vidisplayed English during all reload feedback. - Fix: All four messages now call
plugin.getLangManager().get(key)/.format(key, args)using the existing lang keys (gun.reload_full,gun.reload_no_ammo,gun.reload_failed,gun.reload_done) that were already defined in bothlang/en.ymlandlang/vi.ymlbut never wired up inReloadManager.
🟡 BleedingManager.tryApply() — Inconsistent RNG usage (Medium)
- Root cause:
tryApply()usedMath.random(), which delegates to a single sharedjava.util.Randominstance. This is inconsistent withGunListener, which explicitly replacedstatic RandomwithThreadLocalRandom.current()(with a comment explaining the reasoning). On servers with many simultaneous bleed chance rolls (burst fire hitting multiple targets), the shared lock inMath.random()causes minor contention. - Fix: Replaced
Math.random()withThreadLocalRandom.current().nextDouble(), consistent with the rest of the codebase.
🟡 ThrowableManager.detonateSmoke() — Inconsistent RNG usage (Medium)
- Root cause: Same issue as
BleedingManager—Math.random()used for particle position offsets inside a hot loop (20 calls per 4-tick interval per active smoke grenade). - Fix: Replaced all three
Math.random()calls withThreadLocalRandom.current().nextDouble().
🟡 AttachmentManager — Duplicate import statement (Code Quality)
- Root cause:
AttachmentManager.javacontained two identicalimport org.bukkit.entity.Player;declarations introduced during a refactor. - Fix: Removed the duplicate import.
🟡 GunListener.getRecentDamage() — Mutable map reference exposed via public API (Medium)
- Root cause:
getRecentDamage()returned the internalHashMap<UUID, DamageRecord>reference directly. Any external code (addon plugins accessingGunListenerviaCombatGunAPI) callinggetRecentDamage().clear()or.put(...)could silently corrupt kill-attribution logic without any indication. - Fix 1:
getRecentDamage()now returnsCollections.unmodifiableMap(recentDamage)— external callers can read the map but cannot mutate it. - Fix 2: Added
getDamageRecord(UUID entityId)— a safer lookup method that returns the record only if it is non-null and within the TTL window.EntityDeathListenershould use this instead ofgetRecentDamage().get(uuid)for correct TTL filtering.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.6Релиз1.21.9, 1.21.10, 1.21.11 · 14 мая 2026 г.
[2.0.6] - 2026-05-14
Fixed
🔴 GunListener.isFriendlyFire() — Scoreboard team detection using wrong scoreboard (Critical)
- Root cause:
shooter.getScoreboard()andtargetPlayer.getScoreboard()return each player's personal scoreboard view, which may differ between players when a scoreboard plugin assigns individual views. Team membership is defined on the main scoreboard, so using a personal scoreboard could returnnulleven when both players are on the same team — or vice versa, allowing players to bypass friendly-fire restrictions. - Fix: Replaced both
player.getScoreboard()calls with a singleBukkit.getScoreboardManager().getMainScoreboard()lookup. Team membership is now always evaluated against the authoritative server scoreboard.
🔴 GunListener — Memory leak in recentDamage map (Critical)
- Root cause:
recentDamageentries were only evicted bypruneRecentDamage(), which runs after each shot. Players who disconnected (crash,/kick, network drop) or died without triggering a subsequent shot by another player left staleDamageRecordentries in the map indefinitely, growing unbounded on long-running servers. - Fix: Added
recentDamage.remove(p.getUniqueId())to bothonQuit()andonDeath()event handlers, ensuring entries are cleaned up immediately when a player leaves or dies — in addition to the existing TTL-based pruning.
🟡 GunListener — Shared static Random causes thread contention and predictable spread (Medium)
- Root cause:
private static final Random RANDOM = new Random()is shared across all usages ofGunListener. Java'sRandomis thread-safe via internal synchronization, which causes lock contention when multiple players fire simultaneously, and its LCG algorithm produces correlated sequences when called rapidly — making bullet spread slightly predictable. - Fix: Replaced the shared field with a private helper
rng()that returnsThreadLocalRandom.current(). Each thread gets its own independent, higher-quality RNG with zero contention. All threeRANDOM.nextDouble()call sites updated torng().nextDouble().
🟡 StatsManager — Unsynchronized async DB access on shared connection (Medium)
- Root cause:
flushBuffer()issynchronizedon theStatsManagerinstance, butincrementGunKill()andgetGunKills()— both called from async tasks — are not. All three methods share the same JDBCConnection. Concurrent execution offlushBuffer()andincrementGunKill()could interleave SQL transactions, causingSQLITE_BUSYerrors, corrupted auto-commit state, or inconsistent read results ingetGunKills(). - Fix: Marked both
incrementGunKill()andgetGunKills()assynchronized. All three DB-touching methods now synchronize on the same monitor (theStatsManagerinstance), serializing access to the sharedconnectionwithout requiring a connection pool.
2.0.5Релиз1.21.9, 1.21.10, 1.21.11 · 26 апреля 2026 г.
[2.0.5] - 2026-04-26
Added
AttachmentApplyEvent and AttachmentRemoveEvent — Developer API
- Two new cancellable events fire when a player attaches or removes an attachment from a gun.
AttachmentApplyEvent— fired beforefitAttachment()writes the PDC key. ProvidesgetPlayer(),getGunData(),getIncoming()(attachment being fitted), andgetReplacedAttachment()(previously occupied slot, ornull). Cancellable — cancel to block the attachment action.AttachmentRemoveEvent— fired beforeremoveAttachment()clears the PDC key. ProvidesgetPlayer(),getGunData(),getSlot(), andgetRemoved()(the attachment being stripped). Cancellable — cancel to block the removal.AttachmentManager.fitAttachment(Player, ItemStack, GunData, String)— new overload that fires the apply event. The no-player overload is retained for internal use.AttachmentManager.removeAttachment(Player, ItemStack, GunData, AttachmentType)— new overload that fires the remove event.- Example use-cases: locking legendary weapons from modification, auto-returning detached attachments to the player's inventory, logging equipment changes, restricting attachments in specific regions.
DamageCalculator — Centralised Damage Math Utility
- New
util/DamageCalculator.javaextracts all damage-pipeline calculations fromGunListener, making them independently testable and accessible to add-on plugins. - Static methods:
baseDamage(GunData, double eventMult)— gun damage × projectile multiplier × event multiplier.falloffMultiplier(GunData, double dist)— linear range-based damage reduction fromdamageFalloffStartto min floor.headshotMultiplier(GunData, boolean headshot)— returnsheadshotMultiplieror1.0.finalDamage(GunData, double dist, boolean headshot, double eventMult)— full pipeline in one call.isHeadshot(double hitY, double baseY, double height, boolean crouching)— single source of truth for headshot detection, accounting for crouch state.effectiveSpread(GunData, double scopeSpread, boolean scoped, boolean ads, double moveMult)— spread value for all fire modes.pelletSpread(double baseSpread, boolean multiPellet)— per-pellet spread for shotguns.
- Named constants:
HEAD_ZONE_START(0.80),CROUCH_FACTOR(0.85),SHOTGUN_SPREAD_FACTOR(1.45) — previously magic numbers scattered acrossGunListener. GunListenernow delegates all damage math and spread calculations toDamageCalculator. The privatecomputeFalloffMultiplier()method has been removed (logic moved toDamageCalculator.falloffMultiplier()).
StatsManager — Per-Kill Detail Log (kills_by_gun_detail table)
- New SQLite table
kills_by_gun_detailadded via schema migration v3. Stores one row per kill withuuid,gun_id,headshotflag, and Unixtimestamp(ms). - Enables future features: per-weapon leaderboards, session-based kill analytics, and season resets that preserve historical totals in the detail log while zeroing the aggregate counters.
- Two covering indexes (
idx_kbgd_uuid,idx_kbgd_gun) ensure per-player and per-weapon queries stay fast as the table grows. - Schema migration runs automatically on first startup of 2.0.5 — no manual SQL required.
GunCommand — Season Reset and Per-Player Stats Reset
/gun statsreset <player>— resets kills, deaths, headshots, gun kills, and detail records for a single online player. Wipes the in-memory buffer and schedules async DB deletes across all three stat tables./gun seasonreset confirm— resets ALL players' stats (requires the literalconfirmargument as a safeguard against accidental use). Clears the in-memory buffer and truncatesplayer_stats,gun_kills, andkills_by_gun_detailin a single transaction. Prints a gold confirmation message on success.- Both commands require
combatgun.adminpermission. - Both commands fail gracefully with a clear error if
StatsManageris disabled (SQLite unavailable).
Improved
GunListener — God Class Reduction
performShot()spread logic (previously a three-branchif/else if/elseblock) replaced with a singleDamageCalculator.effectiveSpread()call.applyEntityDamage()damage calculation (previously inline) replaced withDamageCalculator.finalDamage()andDamageCalculator.baseDamage().isHeadshot()private method now delegates entirely toDamageCalculator.isHeadshot()— single source of truth for headshot geometry.- Removed
computeFalloffMultiplier()private method (~7 lines) — logic now lives inDamageCalculator.
StatsManager — Schema Version Bumped to 3
SCHEMA_VERSIONconstant updated from2to3.recordKill()now passes theheadshotflag toincrementGunKill()so both the aggregategun_killstable and the newkills_by_gun_detailtable are updated in one async task.resetStats(UUID)now also deletes fromkills_by_gun_detailin addition toplayer_statsandgun_kills.resetAllStats()truncates all three stat tables in a single transaction.
2.0.3Релиз1.21.9, 1.21.10, 1.21.11 · 18 апреля 2026 г.
[2.0.3] - 2026-04-18
Fixed
🔴 AmmoPouchManager.unpackPouch() — Pouch lost when inventory is full (Critical)
- Root cause: When partially unpacking (only a few slots left in inventory), the code always called
pouch.setAmount(0)regardless of how many bullets were actually transferred. The entire pouch was destroyed even if bullets remained inside. - Fix: If
remaining > 0(unpack not completed), update the PDCpouch_quantityto the remaining amount and refresh the lore instead of destroying the pouch. Only callsetAmount(0)when all bullets have been successfully transferred.
🔴 ReloadManager — Reload task running every 1 tick causing high CPU usage (Critical)
- Root cause:
runTaskTimer(plugin, 0L, 1L)scheduled 20 times per second for every player reloading. With 10 players reloading simultaneously, this resulted in 200 task calls per second just for the progress bar. - Fix: Changed to
runTaskTimer(plugin, 0L, 2L)and adjustedtotalTicks = reloadTime * 10.0so reload duration remains unchanged. This reduces reload system CPU load by approximately 50%.
🔴 GunListener.isHeadshot() — Inaccurate headshots while player is crouching (Critical)
- Root cause: Used fixed
entity.getHeight() * 0.8without accounting for crouching players (hitbox shrinks to ~1.5 blocks instead of 1.8). - Fix: Detect
player.isSneaking()and multiplyheight *= 0.85before calculating headY threshold. Headshot detection is now accurate for both standing and crouching states.
🔴 CraftingManager.craftFromStation() — No rollback when crafting fails (Critical)
- Root cause:
consumeIngredients()ran beforecreateResultItem(). IfcreateResultItem()returnednull(invalid gun ID, config error, etc.), ingredients were consumed but no item was given → permanent item loss. - Fix: Snapshot all input slots before consuming. If
createResultItem()returnsnull, restore ingredients from the snapshot.
🟡 GunListener.applyRecoil() — Potential NPE when AntiCheatHook is disabled (Medium)
- Root cause:
if (hm2 != null) hm2.getAntiCheatHook().exempt(player)— checkedhm2but notgetAntiCheatHook(). If the hook was disabled,getAntiCheatHook()could return an uninitialized instance. - Fix: Added full guard:
hm2 != null && hm2.getAntiCheatHook() != null && hm2.getAntiCheatHook().isActive()before callingexempt().
🟡 BleedingManager — Incorrect damage during server lag (Medium)
- Root cause: Task used
elapsed += 20to count ticks, but when the server lagged (>50ms per tick), actual damage was lower than the configureddamage_per_second. - Fix: Switched to
System.currentTimeMillis()for real-time tracking.lastDamageTimeis now updated only when damage is actually applied, ensuring exactly 1 second between damage ticks regardless of server lag.
🟡 CraftingManager.consumeIngredients() — Incorrect null-check order (Medium)
- Root cause:
identifyIngredient(item)was called before checkingitem == null, causing potential NPE with empty inventory slots in some edge cases. - Fix: Moved
if (item == null || item.getType().isAir()) continue;before callingidentifyIngredient().
🟡 GunListener.onItemHeldChange() — Race condition when switching slots rapidly (Medium)
- Root cause: Task with 0-tick delay read
getItemInMainHand()— if the player switched slots again before the task ran, it would process the wrong slot's item. - Fix: Store
newSlot = event.getNewSlot()before scheduling the task. Inside the task, checkplayer.getInventory().getHeldItemSlot() != newSlotand abort if the player has switched slots again.
2.0.2Релиз1.21.9, 1.21.10, 1.21.11 · 14 апреля 2026 г.
[2.0.2] - 2026-04-14
Fixed
NullPointerException: HudManager.sendNow() when shooting any gun
- Root cause:
GunListenercachedplugin.getHudManager()into afinal HudManager hudManagerfield inside its constructor. However,GunListeneris instantiated inregisterListeners()which runs beforestartServices()whereHudManageris created. The field was alwaysnullat the time of assignment. - Fix: Removed the cached
hudManagerfield entirely. All two call-sites now useplugin.getHudManager()inline with a null-guard:if (plugin.getHudManager() != null) plugin.getHudManager().sendNow(player). This makes the call lazy — it resolves the reference at the moment of use rather than at construction time, so startup order no longer matters.
Комментарии
Загружаем…