HyWeaponVariants

Variants of different weapons.

File Details

HyWeaponVariants-0.0.3.jar

  • R
  • Feb 25, 2026
  • 125.78 KB
  • 106
  • Early Access

File Name

HyWeaponVariants-0.0.3.jar

Supported Versions

  • Early Access

 

🆕 New Features

Randomized Variant System (0–5 effects per weapon)

  • Each weapon now rolls a random number of active variants (bonus effects) on first creation, in addition to the existing stat multipliers
  • Default range is 0 to 3 variants — configurable via variantCount.min / variantCount.max in the config
  • Weapons with 0 variants are perfectly plain with no bonuses, adding meaningful loot variance
  • Variant selection uses a weighted shuffle so rarer effects appear less often

23 Built-in Variant Types

Added a full variantPool covering all major weapon archetypes:

Category Variants
Damage Bonus Damage, Crit Chance, Crit Damage, Armor Penetration, Elemental Damage
On-Hit Procs Poison, Ignite, Freeze, Stun, Bleed
Sustain Life Steal, Thorns
Mobility / Utility Attack Speed, Move Speed, Knockback, Reach
Ranged Projectile Speed, Charge Speed, Pierce / Bounce
Resource Mana Cost, Signature Energy, Stamina Cost
Durability Durability (rare)

All variants are fully configurable — add, remove, or reweight any entry in variantPool in the config with no code changes required.

New Config Fields

  • variantCount — controls min/max number of variants rolled per weapon
  • variantPool — list of available variant types with id, label, multiplier range, weight, and rating settings
  • Active variant ids are stored in item metadata under activeVariants for tooltip and stat-sync systems to enumerate

🐛 Bug Fixes

  • WeaponVariantPlayerReadyListener was missing — referenced in start() but never defined, causing a compile error. Now implemented: strips legacy variant tags from arrow stacks on PlayerReadyEvent so bows and crossbows correctly consume ammo
  • Duplicate stat weights in RatingHealingRadius and SlowingRadius were registered twice in the default statWeights map, silently overwriting themselves. Removed duplicates
  • Duplicate prettifyStatId branches — identical if-blocks for HealingRadius and SlowingRadius were dead code. Removed and expanded to cover all new variant ids with proper display names
  • Triple-duplicated glob matching logic — the same glob-to-regex conversion was copy-pasted across VariantMeta, HyWeaponVariantsPlugin, and an internal helper. Extracted into a shared GlobUtil utility class
  • Bows and arrows can now be used

⚡ Optimisations

  • GlobUtil.matches() now has a fast path for patterns without * or ? wildcards — skips regex compilation entirely and uses direct case-insensitive equality
  • Range.sample() clamp logic simplified
  • Removed a redundant rnd == null guard inside the stat-roll loop in ensureVariant

🔧 Build

  • Added @SuppressWarnings("removal") on PlayerCraftEvent usage — the event is deprecated for removal in a future patchline but remains the most reliable post-craft rescan hook for now