mojira.dev
MCPE-165612

@minecraft/server.EntityDamageCause does not contain "sonic_boom"

The ranged attack of Warden could cause damage whose type is sonic_boom. But in fact, EntityDamageCause does not contain "sonic_boom". So if you subscribe the EntityHurtEventSignal and try to get the EntityHurtEvent.cause(until 1.19.60.25) or EntityHurtEvent.damageSource.cause(after 1.19.60.25) in the callback, instead of returning "sonic_boom", it will return undefined.

It it worth noting that you can only cause this type of damage by using minecraft:behavior.sonic_boom component. Because although the cause parameter of minecraft:hurt_on_condition component and minecraft:area_attack component accepts "sonic_boom", it actually uses "none" to do damage. But in blocks and items, the type parameter of damage event response does not accepts "sonic_boom" at all. /damage command does not support "sonic_boom" as well.

What is more, damage_sources parameter of minecraft:behavior.panic component and minecraft:behavior.play_dead component does not accept sonic_boom either.

Entity.applyDamage, which is added in 1.19.60.25, can apply certain type of damage to entity by passing EntityDamageSource.cause. However, "sonic_boom" is still unavailable and will throw an error (TypeError: Native optional type conversion failed).

Interestingly, if you try to use sonic_boom in minecraft:damage_sensor component (both of has_damage entity filter and cause parameter of trigger), you will find it working properly.

In summary, the table below will show all the problems.

name

type

status quo

expectation

note

@minecraft/server.EntityDamageCause

Enumeration (SAPI)

sonicBoom = undefined

sonicBoom = "sonic_boom"

-

@minecraft/server.Entity.applyDamage

Function (SAPI)

TypeError: Native optional type conversion failed.

apply "sonic_boom" type damage and return a Boolean without throwing any errors

the source parameter is

{ cause: "sonic_boom" }

@minecraft/server.EntityHurtEvent.cause

String? (SAPI)

undefined

"sonic_boom"

the ranged attack from Warden

minecraft:area_attack

Entity Component (Data Driven)

apply "none" type damage

apply "sonic_boom" type damage

the cause parameter is "sonic_boom"

minecraft:behavior.panic

Entity Component (Data Driven)

[Json][error] | actor_definitions | Damage Source not found sonic_boom

get panicked after receiving "sonic_boom" type damage

the damage_sources parameter includes "sonic_boom"

minecraft:behavior.play_dead

Entity Component (Data Driven)

[Json][error] | actor_definitions | Damage Source not found: sonic_boom

play dead after receiving "sonic_boom" type damage

the damage_sources parameter includes "sonic_boom"

minecraft:hurt_on_condition

Entity Component (Data Driven)

apply "none" type damage

apply "sonic_boom" type damage

the cause parameter is "sonic_boom"

damage

Blocks/Items Event Response (Data Driven)

[AI][error]-Unknown damage type in damage response

apply "sonic_boom" type damage

the type parameter is "sonic_boom"

/damage

Command

Syntax error: Unexpected "sonic_boom" at "/damage @e 1 >>sonic_boom<<"

apply "sonic_boom" type damage

the cause parameter is "sonic_boom"

Linked issues

Attachments

Comments 4

I can confirm this. As a new damage type, sonic_boom is still not supported by various technical contents.

Thank you for your report!

However, this issue has been temporarily closed as Awaiting Response.

Could you please attach an example behavior pack where this issue can be observed?

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki

But as the Description shows, this can be easily reproduced without any behavior pack, just using /damage command.
For example:
/damage @s 1 ...
Note that there's no sonic_boom in the autocompletion list.
Run /damage @s 1 sonic_boom
Note that a parsing error occurs.

We do not have enough information to reproduce this issue.
I can no longer reproduce the issue with the /damage command. Is this still an issue as of the latest version/Preview? If so, then please include the following information to help us understand your problem:

Steps to Reproduce:
1. (Explain what needs to be done for the issue to happen)
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

2190303755

(Unassigned)

1025100

Confirmed

Multiple

Windows 11 22H2

Add-on, command, component, event, scripts

1.19.80.22 Preview, 1.19.80.21 Preview, 1.19.80.20 Preview, 1.19.70.26 Preview, 1.19.70.24/25 Preview, ..., 1.19.70, 1.19.71, 1.19.72, 1.20.0.24 Preview, 1.19.81 Hotfix

Retrieved