Skip to content

server/entity: Match Bedrock arrow damage - #1346

Open
HashimTheArab wants to merge 4 commits into
df-mc:masterfrom
HashimTheArab:agent/fix-bedrock-arrow-damage
Open

server/entity: Match Bedrock arrow damage#1346
HashimTheArab wants to merge 4 commits into
df-mc:masterfrom
HashimTheArab:agent/fix-bedrock-arrow-damage

Conversation

@HashimTheArab

@HashimTheArab HashimTheArab commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • use Bedrock arrow impact damage instead of combining Bedrock launch velocity with Java damage scaling
  • apply the Bedrock Power multiplier after critical damage
  • preserve Power and critical state through arrow NBT
  • correct crossbow arrow damage and launch velocity

Root cause

Dragonfly launches bow arrows with Bedrock velocity (force * 5) but calculated impact damage using Java-style ceil(base damage * velocity). A fully charged unenchanted bow therefore dealt 10-15 raw damage instead of Bedrock’s 9-10 critical range. Crossbows were affected more severely because their configured damage of 9 was multiplied by their launch velocity, and their launch speed was incorrectly set to 5.15 instead of Bedrock’s dedicated crossbow arrow power of 3.15.

This changes all arrow entities to one consistent Bedrock damage model: base damage plus 97% of current velocity, the 9-10 critical range, then Power scaling. Non-arrow projectiles keep their existing calculation.

The crossbow velocity was verified against the official BDS 1.26.36.1 binary: the crossbow constructor initializes mDefaultArrowPower to 3.15f, and the arrow firing path passes that field directly to the projectile shoot call.

Reference: https://learn.microsoft.com/en-us/minecraft/creator/reference/source/vanillabehaviorpack_snippets/entities/arrow

Validation

  • go test ./...
  • git diff --check

@HashimTheArab
HashimTheArab force-pushed the agent/fix-bedrock-arrow-damage branch from 66517db to 881b83a Compare July 23, 2026 01:05
@HashimTheArab
HashimTheArab force-pushed the agent/fix-bedrock-arrow-damage branch from 881b83a to 9420ecc Compare July 23, 2026 01:10
@xSuperr

xSuperr commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

LGTM

ethaniccc
ethaniccc previously approved these changes Jul 25, 2026
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.

3 participants