LiquidBounce icon indicating copy to clipboard operation
LiquidBounce copied to clipboard

feat(invcleaner): add BestKnockback sort slot

Open m1trenv0 opened this issue 5 months ago • 0 comments

What

Adds a BestKnockback option to InventoryCleaner's slot sorting list.

Any item carrying a Knockback enchantment (a stick, a sword, an axe…) can now be kept and sorted into a dedicated hotbar slot instead of being thrown away as junk — handy for knocking players into the void on maps like SkyWars.

How

  • New ItemType.KNOCKBACK:
    • Low allocation priority (NORMAL) — below the existing weapon types (SWORD/WEAPON/SPEAR/MACE), so a real weapon is still allocated as the main weapon first.
    • Not a WEAPON_LIKE function — so it is not deduplicated against the chosen weapon; a separate, lesser Knockback item is kept in its own slot rather than discarded.
    • oneIsSufficient = true — only the single best Knockback item is kept; worse ones are thrown.
  • New KnockbackItemFacet ranks candidates by Knockback level (then durability, enchantability, hotbar preference).
  • ItemSortChoice.BEST_KNOCKBACK exposes it in the UI; getItemFacets attaches the facet to any item with a Knockback enchantment.

Example

Player has a sword with Knockback IV and a stick with Knockback III:

  • the sword fills the Sword/Weapon slot (high priority, as before),
  • the stick is kept in the BestKnockback slot,
  • any additional, weaker Knockback item is discarded.

🤖 Generated with Claude Code

m1trenv0 avatar Jun 04 '26 14:06 m1trenv0