LiquidBounce
LiquidBounce copied to clipboard
feat(invcleaner): add BestKnockback sort slot
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_LIKEfunction — 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.
- Low allocation priority (
- New
KnockbackItemFacetranks candidates by Knockback level (then durability, enchantability, hotbar preference). ItemSortChoice.BEST_KNOCKBACKexposes it in the UI;getItemFacetsattaches 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