mojira.dev
MCPE-236353

Ghast Fireballs Rejected by the Player are not considered the Player as the Damaging Entity

The following code works in singleplayer, but not on realms:

world.afterEvents.entityDie.subscribe((event) => {
  const deadEntity = event.deadEntity;
  const damageSource = event.damageSource.damagingEntity;
  const damageProjectile = event.damageSource.damagingProjectile;
    if (
      damageSource.typeId === "minecraft:player" &&
      damageProjectile.typeId === "minecraft:fireball" &&
      deadEntity.typeId === "minecraft:ghast"
    )
      damageSource.runCommand("say Success!");
  });

Even if I remove the fireball requirement in line 7 (included in this sample code to avoid accidentally killing the ghast some other way), it still does not work on realms but does work on singleplayer. The only variable remaining is that the Player is not counted as the damagingEntity on realms.

Steps to reproduce: Run a scripting addon with this in the script.

Expected result: “Success!” shows in chat on both singleplayer and realms – consistent behavior across both environments.

Actual result: “Success!” shows only in singleplayer.

Comments 1

Hi!
Thank you for your report! 

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

  • Can you upload an add-on this issue can be reproduced with?

This ticket will automatically reopen when you reply. Thanks!

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

TheRoyalBlock

(Unassigned)

Unconfirmed

26.0

Retrieved