Blocking
Blocking allows an entity to intercept an eligible attack before ordinary hit damage and reactions are applied. Successful blocks may play an impact animation, spawn a block flash, play a block sound, consume guard points, apply chip damage, and execute block scripts.
The native system separates three questions:
- Will the entity attempt to block? Player input or AI behavior establishes a blocking state.
- Can the attack be blocked? Facing, native guard points, block penetration, block power, and block threshold determine eligibility unless the current block-state flags bypass the applicable check.
- What happens after the block? Blockpain, guard cost, chip damage, sounds, flashes, and scripts provide the result.
Block is required for normal native initiation and anticipatory targeting. It is not part of the final block-eligibility check once the entity is already in a blocking state. Scripts may set ENTITY_PROPERTY_BLOCK_STATE and allow an entity without anim block to block an otherwise eligible hit. Other blocking animations are optional.
Blocking Flow
Player Blocking
Player entities with anim block initiate blocking by pressing the Special key while grounded. OpenBOR stops X and Z movement, ends the current combo step, sets the blocking state, and plays Blockstart when available. Otherwise, Block begins immediately.
Defining Block normally takes priority over the standard Special animation. Projects may place the usual special command on another input through control configuration, such as Attack + Jump.
The length of Block and the model's block configuration determine whether a player must press, hold, or release Special to maintain the guard.
AI Blocking
AI entities can block in two ways:
- Impact blocking - When an attack connects, a previously nonblocking AI entity with
anim blockmay begin blocking if it is idle, grounded, unfrozen, not falling, not grappling, and not actively attacking. Each eligible impact normally performs a new block-odds check. An entity already in a blocking state does not repeat the Block-animation initiation check. - Anticipatory blocking - When
block_config activeis enabled, AI may enter Block before an attack connects. OpenBOR searches for the nearest living, detectable attacker within the Block animation's range, so this form requiresanim block. The candidate must be able to damage the defender, be actively attacking, and have a currently active attack box considered potentially blockable.
The active flag adds anticipatory behavior without removing impact blocking. AI with active blocking may still begin a block on impact if anticipation did not occur. Once actively blocking, the entity continues to block successive eligible impacts without repeating the odds roll until its blocking state ends.
Block Eligibility
Once an entity is in a blocking state, the incoming attack must pass every applicable eligibility test.
| Test | Current behavior |
|---|---|
| Disabled flag | block_config disabled prevents blocking outright, including script-forced block states. No block-state override bypasses it.
|
| Facing | Attacks from behind cannot be blocked unless block_config back or BLOCK_STATE_IGNORE_DIRECTION is enabled.
|
| Guard points | Native blocking requires current guard points above 0 when the model maximum is positive. Plain script-controlled blocking does not use the guard-point system. BLOCK_STATE_IGNORE_GUARD_POINTS bypasses it for a native block.
|
| Penetration and power | When either value is nonzero, defense.block.power must be strictly greater than attack.block.penetrate. BLOCK_STATE_IGNORE_ATTACK_ELIGIBILITY bypasses this comparison.
|
| Threshold | The attack's raw damage force must meet or exceed thold + defense.block.threshold. BLOCK_STATE_IGNORE_ATTACK_ELIGIBILITY bypasses this comparison.
|
Successful Block
When a block succeeds, OpenBOR performs the following sequence. Steps marked native do not run for a plain script-controlled automatic block frame.
- For native blocking, selects Blockpain or Block according to blockpain.
- Spawns the attack's block flash or the defender's default block flash.
- Runs the attacker's Didhit script with
blocked = 1. - For native blocking, sets or refreshes the defender's blocking action and stops X and Z movement.
- For native blocking, deducts
attack.block.costfrom current guard points when the guard-point system is enabled and not ignored. - Counts the collision as a hit for the attacker's animation and follow-up logic.
- Runs the defender's Didblock script.
- Applies any configured chip damage.
- Plays the attack's block sound or the global block sample.
See Hit Effects for block flash and sound selection.
Animations
Block
anim block
Basic blocking animation. Block is required for normal native initiation and anticipatory targeting. It is not required by the final eligibility check for an entity already in a blocking state.
Player entities normally enter Block with the Special key. Native AI requires Block before a previously nonblocking entity may initiate impact blocking, and the animation's range controls anticipatory targeting. The actual impact reaction may use Blockpain instead. Block remains an active blocking state for its entire duration.
Blockstart
anim blockstart
Optional transition into Block. OpenBOR plays Blockstart when a player or anticipatory AI entity actively begins guarding before impact. Block follows when Blockstart completes.
Blockstart is already a blocking state. A successfully blocked impact during Blockstart immediately selects the appropriate Blockpain or Block reaction.
Blockpain
anim blockpain
anim blockpain2
anim blockpain3
...
anim blockpain10
anim blockpainb
anim blockpains
Optional native impact reactions for a successful block. Blockpain is block stun, not an ordinary pain animation. The entity remains in a blocking state while it plays. Plain script-controlled automatic block frames preserve their current animation instead.
OpenBOR maps the incoming attack type to a Blockpain animation:
| Attack type | Preferred animation |
|---|---|
| Normal / Normal1 | Blockpain |
| Normal2 through Normal10 | Blockpain2 through Blockpain10 |
| Burn | Blockpainb |
| Shock | Blockpains |
| Blast, Freeze, Steal, and special internal types | Blockpain |
The normal Blockpain animation acts as the general fallback when no dedicated type reaction is available.
See blockpain for the force comparison that decides whether OpenBOR requests Blockpain or returns to Block.
Blockrelease
anim blockrelease
Optional native transition out of blocking. OpenBOR plays Blockrelease when the blocking action ends before returning the entity to Idle.
Blockrelease remains a blocking state. A successfully blocked impact during the transition interrupts it with the appropriate Blockpain or Block reaction. Once that reaction and any configured hold behavior finish, OpenBOR may return to Blockrelease.
Guardbreak
anim guardbreak
Optional reaction used by the native guard-point system. Guardbreak represents an exhausted guard and is treated as a pain reaction rather than a successful block reaction.
Current guard points are restored to the model's maximum when OpenBOR selects the Guardbreak reaction. When Guardbreak is unavailable, normal pain-animation fallback applies.
Chipdeath
anim chipdeath
Optional death animation for lethal chip damage. When an entity dies while still marked as blocking, Chipdeath takes priority over its attack-type death animation. Normal death-animation fallback applies when Chipdeath is unavailable.
Model Configuration
The following commands belong in an individual model's text file.
Block Configuration
block_config <flags>
# Default after parsing type player
block_config active
# Default for other entity types
block_config none
Sets the model's native blocking behavior as a bitmask. Multiple flags may be supplied on one line.
| Flag | Description |
|---|---|
none
|
Zero value. It has no effect when combined with other flags. |
active
|
Adds human-like AI blocking behavior. AI may anticipate an incoming attack and enter Block before impact. Once blocking, it continues across successive eligible impacts without another odds roll. Normal impact blocking remains available whether this flag is present or not. Player models receive this flag by default when their type player command is parsed.
|
back
|
Allows attacks from behind to pass the facing eligibility test. |
disabled
|
Disables blocking outright, including player input, AI impact or anticipatory blocking, and script-forced block states. |
hold_impact
|
Allows a player to hold Special and maintain Block until an attack is blocked. The guard is released after the resulting block stun completes. |
hold_infinite
|
Allows a player to hold Special and maintain Block indefinitely, including returning to Block after block stun. |
The block_config command replaces the complete flag mask at the point where it is parsed. Flags omitted from the command are cleared.
Script
Block configuration is available through MODEL_PROPERTY_BLOCK_CONFIG_FLAGS. The corresponding bitmask constants are:
openborconstant("BLOCK_CONFIG_NONE")openborconstant("BLOCK_CONFIG_ACTIVE")openborconstant("BLOCK_CONFIG_BACK")openborconstant("BLOCK_CONFIG_DISABLED")openborconstant("BLOCK_CONFIG_HOLD_IMPACT")openborconstant("BLOCK_CONFIG_HOLD_INFINITE")
Legacy Commands
Legacy commands remain available and modify the same flag mask. These are provided as a reference. Do not use legacy commands in your projects. They may cause undefined behavior and are subject to depreciation without notice.
| Legacy command | Modern equivalent |
|---|---|
blockback 0
|
Clear back.
|
blockback 1
|
Set back.
|
holdblock 0
|
Clear hold_impact and hold_infinite.
|
holdblock 1
|
Set hold_impact.
|
holdblock 2
|
Set both hold_impact and hold_infinite.
|
nopassiveblock 0
|
Clear active.
|
nopassiveblock 1
|
Set active.
|
Block Odds
blockodds {int}
# Default
blockodds 0
Controls AI block decisions. Player-controlled entities do not use this property. The current implementation performs the following test:
(rand32() & blockodds) == 0
This is a bit-mask probability, not a percentage or a simple one-in-blockodds ratio. For a nonnegative value, the chance is 1 / 2^n, where n is the number of set bits in blockodds.
| Value | Set bits | Chance per decision |
|---|---|---|
0
|
0 | 100% |
1
|
1 | 1 in 2 |
3
|
2 | 1 in 4 |
7
|
3 | 1 in 8 |
15
|
4 | 1 in 16 |
31
|
5 | 1 in 32 |
100
|
3 | 1 in 8 |
2147483647
|
31 | 1 in 2,147,483,648 |
Values in the form 2^n - 1 - such as 1, 3, 7, 15, and 31 - provide the most intuitive progression.
AI must still satisfy its state and attack-eligibility rules after the odds check. Value 0 therefore means every eligible decision succeeds, not that every attack in every state will be blocked. AI already blocking with block_config active, or using BLOCK_STATE_IGNORE_CHANCE, bypasses this roll.
Script access uses MODEL_PROPERTY_BLOCK_ODDS.
Block Pain
blockpain {int}
# Default
blockpain 0
Controls whether a successful native block requests a Blockpain animation according to the incoming attack's raw damage force.
Behavior: Blockpain is requested when attack.damage.force is greater than or equal to blockpain. Attacks below the threshold use the regular Block animation. Consequently, the default value of 0 makes every ordinary nonnegative blocked attack eligible to request Blockpain.
The engine first looks for an attack-type-specific Blockpain animation, then its fallback Blockpain animation. If neither is valid, the defender uses the regular Block animation.
Plain script-controlled blocking does not change animation and therefore does not request Blockpain. Native blocking with BLOCK_STATE_IGNORE_BLOCKPAIN uses Block instead.
Script access uses MODEL_PROPERTY_BLOCK_PAIN.
Guard Points
guardpoints {int}
# Default
guardpoints 0
Enables native guard exhaustion and sets the maximum guard-point value. Each spawned entity begins with current guard points equal to this model value.
0- Guard exhaustion is disabled.1+- Each successfully blocked native attack subtracts itsattack.block.costvalue.
Eligibility is checked before guard cost is deducted. The hit that reduces guard points to 0 or below is therefore still blocked. Subsequent attacks cannot be blocked through the native guard-point path while guard points remain depleted.
Plain script-controlled blocking does not check or deduct guard points. Native blocking with BLOCK_STATE_IGNORE_GUARD_POINTS also bypasses the guard-point eligibility check and deduction.
When the next eligible pain reaction is processed with depleted guard points, OpenBOR selects Guardbreak, restores current guard points to the model maximum, suppresses the guard-breaking hit's normal damage, and prevents that hit from causing knockdown or ordinary damage effects.
Script access:
MODEL_PROPERTY_GUARD_POINTS- Model maximum.ENTITY_PROPERTY_GUARD_POINTS- Entity's current value.
Guard Rate
guardrate {int}
# Default
guardrate 2
Sets guard-point recovery per game-second tick. Recovery is capped at the model's guardpoints value.
- Not using native guard-point blocking - Recover the full
guardratevalue. - Native blocking with guard points enabled - Recover
guardrate / 2using integer division.
For example, guardrate 3 restores 3 points per tick normally and 1 point per tick during native guard-point blocking. Value 1 restores no points in that state because integer division produces 0. Plain script-controlled blocking and native blocking with BLOCK_STATE_IGNORE_GUARD_POINTS recover at the full rate.
Script access:
MODEL_PROPERTY_GUARD_RATE- Recovery amount.ENTITY_PROPERTY_GUARD_TIME- Next scheduled recovery tick.
Threshold
thold {int}
# Default
thold 0
Provides a model-wide adjustment to defense.block.threshold. OpenBOR adds both values for the incoming attack type:
combined threshold = thold + defense.block.threshold
If the combined threshold is any value other than 0, attacks with raw attack.damage.force that meet or exceed the combined threshold cannot be blocked.
Script access uses MODEL_PROPERTY_BLOCK_THRESHOLD.
Attack and Defense Configuration
Attack and defense commands provide per-attack control over blocking. See Collision and Damage Control for the complete property sets.
Global Configuration
The following legacy module-wide commands belong in Models.txt. Per-type defense properties provide more precise control for new projects.
Block Ratio
blockratio {bool}
# Default
blockratio 0
Controls the fallback chip-damage ratio when the relevant defense.block.ratio remains unset.
0- Blocked attacks inflict no damage by default.1+- Blocked attacks inflict 25% of offense-adjusted damage by default.
An explicit defense.block.ratio value overrides this global fallback, including an explicit 0.0.
Script access uses GLOBAL_CONFIG_PROPERTY_BLOCK_RATIO.
MP Block
mpblock {bool}
# Default
mpblock 0
Controls the global resource used for chip damage when defense.block.type is 0.
0- Apply blocked damage to HP.1+- Apply blocked damage to MP first, then any remainder to HP.
Script access uses GLOBAL_CONFIG_PROPERTY_BLOCK_TYPE.
No Chip Death
nochipdeath {bool}
# Default
nochipdeath 0
Controls whether blocked damage may deplete HP.
0- Chip damage may kill.1+- Chip damage cannot reduce HP below1.
This setting does not prevent MP from reaching 0.
Chip Damage
Successful blocks use the defender's block-specific damage path instead of ordinary defense damage factors.
- Begin with
attack.damage.force. - Apply the attacker's offense factor, adjustment, minimum, and maximum for the attack type.
- Apply
defense.block.ratio, or the global Block Ratio fallback when that property is unset. - Apply
defense.block.damage.adjust. - Clamp the result to
defense.block.damage.minanddefense.block.damage.max. - Route the result according to
defense.block.typeor global MP Block setting. - Apply No Chip Death when remaining damage reaches HP.
Ordinary defense.factor and defense.damage.* properties do not apply to a successfully blocked hit. See Damage Control for the full offense and defense calculation order.
Script Access
Properties
Current property APIs expose blocking at global, model, entity, and attack levels.
| Scope | Property constants |
|---|---|
| Global configuration | GLOBAL_CONFIG_PROPERTY_BLOCK_RATIO
|
| Model | MODEL_PROPERTY_BLOCK_CONFIG_FLAGS
|
| Entity | ENTITY_PROPERTY_BLOCK_STATE
|
| Attack object | ATTACK_PROPERTY_BLOCK_COST
|
Use get_global_config_property() and set_global_config_property(), get_model_property() and set_model_property(), get_entity_property() and set_entity_property(), or get_attack_property() and set_attack_property() for the corresponding object.
Block State
ENTITY_PROPERTY_BLOCK_STATE is a writable bitmask describing whether the entity is blocking and which native checks or reactions apply. Combine the following constants with bitwise OR.
| Constant | Bit value | Effect |
|---|---|---|
BLOCK_STATE_NONE
|
0
|
No blocking state. |
BLOCK_STATE_ACTIVE
|
1 << 0
|
The entity may block an eligible hit. Used alone, this creates a script-controlled automatic block frame without native initiation or reactions. |
BLOCK_STATE_NATIVE
|
1 << 1
|
Marks native player or AI blocking. With ACTIVE, OpenBOR may replace the action and animation, stop X and Z movement, use guard points, and select Blockpain. Scripted use should provide a valid Block animation path.
|
BLOCK_STATE_IGNORE_CHANCE
|
1 << 2
|
Makes AI block-odds decisions succeed. Other AI state, target, and eligibility rules still apply. |
BLOCK_STATE_IGNORE_GUARD_POINTS
|
1 << 3
|
For native blocking, bypasses the depleted-guard check and guard-cost deduction. Guard recovery also remains at the full rate. |
BLOCK_STATE_IGNORE_DIRECTION
|
1 << 4
|
Bypasses the facing check. |
BLOCK_STATE_IGNORE_ATTACK_ELIGIBILITY
|
1 << 5
|
Bypasses penetration versus block power and the combined block-threshold comparison. |
BLOCK_STATE_IGNORE_BLOCKPAIN
|
1 << 6
|
For native blocking, skips Blockpain selection and uses Block. |
Setting BLOCK_STATE_ACTIVE alone places the entity directly into a script-controlled block state without player input, AI initiation, an odds roll, or anim block. This supports SNK-style automatic block frames while preserving the creator-controlled action, animation, and movement. Plain script-controlled blocking does not check or deduct guard points and does not request Blockpain.
Facing, penetration versus power, and threshold remain active for this plain state unless their corresponding ignore bits are present. Block flash, Didhit, Didblock, hit counting, chip damage, and block sound still occur after a successful block. block_config disabled remains absolute and rejects the block regardless of state flags.
The following example enables a plain automatic block frame:
set_entity_property(
self,
openborconstant("ENTITY_PROPERTY_BLOCK_STATE"),
openborconstant("BLOCK_STATE_ACTIVE")
);
Additional behavior flags may be combined as needed:
set_entity_property(
self,
openborconstant("ENTITY_PROPERTY_BLOCK_STATE"),
openborconstant("BLOCK_STATE_ACTIVE")
| openborconstant("BLOCK_STATE_IGNORE_DIRECTION")
| openborconstant("BLOCK_STATE_IGNORE_ATTACK_ELIGIBILITY")
);
Scripts must clear the property with BLOCK_STATE_NONE when the automatic block window ends. Add BLOCK_STATE_NATIVE only when the engine should take ownership of the blocking action, movement, guard system, and reaction animation. AI using a script-supplied native state may still perform its normal chance decision unless block_config active already keeps the active block or BLOCK_STATE_IGNORE_CHANCE is included.
Legacy getentityproperty(..., "aiflag", "blocking") access reports only 0 or 1. Use ENTITY_PROPERTY_BLOCK_STATE to inspect the complete mask.
Didblock Script
didblockscript {path}
Runs on the defender after a successful block and after guard cost is deducted. See Didblockscript for details.