AutoBlock

[X] Definitive
AutoBlock — holds a block/shield up while continuously swinging at enemies. On 1.8 it's block-hit autoblock, on 1.21 shield-while-attacking. Ported from Rain's AutoBlockCheck. Vanilla can't swing and use an item simultaneously for more than an instant.
id: autoBlock  ·  class: AutoBlockCheck  ·  group: Combat

What it detects

AutoBlock — holds a block/shield up while continuously swinging at enemies. On 1.8 it's block-hit autoblock, on 1.21 shield-while-attacking. Ported from Rain's AutoBlockCheck. Vanilla can't swing and use an item simultaneously for more than an instant.

Observer signature

On SwingSignal records lastSwingTick. 'swinging' = tick - lastSwingTick < 6; combined with isBlocking, increments autoBlockTicks; flags at level 1.0 when autoBlockTicks exceeds threshold (+30 legacy bonus on 1.8, else 10).

False-positive guards

  • Attacker-in-vehicle exempt
  • lastSwingTick overflow guard (Int.MIN_VALUE -> not swinging)
  • Gated on isBlocking (UseAction.BLOCK), excluding bows (BOW), food (EAT), potions (DRINK)
  • On 1.8 sword-blocking is a normal PvP technique -> +30 tick bonus so legit block-hitters don't flag
  • ProtocolDetector fails open to modern (looser 1.8 gate only loosens)

Configuration

Defaults (editable in-game via the YACL config screen or /ius config):

FieldDefault
enabledtrue
setbackVL5.0
decay0.5
threshold10.0
swing ticks6
1.8 bonus+30.0

Source

src/main/kotlin/dev/iustitia/checks/combat/AutoBlockCheck.kt  ↗