Skip to content

feat(invcleaner): add BestKnockback sort slot#8449

Open
m1trenv0 wants to merge 2 commits into
CCBlueX:nextgenfrom
m1trenv0:feat/invcleaner-best-knockback
Open

feat(invcleaner): add BestKnockback sort slot#8449
m1trenv0 wants to merge 2 commits into
CCBlueX:nextgenfrom
m1trenv0:feat/invcleaner-best-knockback

Conversation

@m1trenv0

@m1trenv0 m1trenv0 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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

Adds a "BestKnockback" choice to InventoryCleaner's slot sorting. Any item
carrying a Knockback enchantment (a stick, a sword, etc.) can now be kept and
sorted into a dedicated slot, instead of being thrown away as junk - useful
for knocking players into the void.

- New ItemType.KNOCKBACK with a LOW allocation priority and no WEAPON_LIKE
  function, so a real weapon is still chosen as the main weapon first while a
  separate, lesser Knockback item is kept in its own slot. Example: a sword
  with Knockback IV fills the weapon slot, a Knockback III stick is kept in
  the BestKnockback slot, and any worse Knockback item is discarded.
- New KnockbackItemFacet ranks candidates by Knockback level (then durability,
  enchantability, hotbar preference). Only the single best is kept.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@m1trenv0 m1trenv0 force-pushed the feat/invcleaner-best-knockback branch from 4dd4335 to a67d08a Compare June 4, 2026 14:12
The BestKnockback slot kept any Knockback item, so a Knockback II fishing rod
was kept even though the main weapon (a sword) already had Knockback II,
making the spare item pointless.

Now a dedicated knockback item is only treated as useful when its Knockback
level is strictly higher than the highest Knockback among real weapons
(swords, spears, maces, axes) in the inventory. A spare item with equal or
lower Knockback than the main weapon is redundant and gets thrown out.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant