mojira.dev
MCPE-172088

scripting API: world.afterEvents.blockBreak always returns minecraft:air

Issue: when  world.afterEvents.blockBreak is fired, the affected block is always minecraft:air

 

Example:

import  * as Minecraft from "@minecraft/server";
 
Minecraft.world.afterEvents.blockBreak.subscribe( (broken) => {
   let blockID=broken.brokenBlockPermutation.type.id;
   let xpos=broken.block.x;
   let ypos=broken.block.y;
   let zpos=broken.block.z;
   Minecraft.world.sendMessage(`Block break detected : ${blockID} at ${xpos},${ypos},${zpos}`);

  }
)

 

1.) register this script as behaviour - pack

2.) Place a block somewhere in the world (for example dirt, cobble-stone etc...)

3.) destroy this block 

4.) the afterEvent from the script fires, but does NOT show the correct blockID

observed: script always returns "minecraft:air" as destroyed block

 

expected: script  should return the destroyed block

 

Script-API Version: 1.3.0-beta

 

EDIT: after shutting down Windows and started all over, the script behaved as expected.
Although, the issue was there, but the trigger is unknown for the moment...

Edit 2: it seems to happen mainly on Bedrock-Server, but also appeared locally 

Attachments

Comments 3

Your report does not contain enough information to understand or reproduce the problem.
What are you expecting to happen instead?
Please edit the Description to include a list of steps along with the Observed and Expected results, as shown here:

Steps to Reproduce:
1. (list every step completely, so someone else can reproduce the issue, and try following your list to make sure you can still reproduce the issue yourself)
2.
3.
Observed Results:
(briefly describe what you see happen, including any message(s) shown)
Expected Results:
(briefly describe what should happen)

Add screenshots or video to help explain (but not replace) the above information

This report has been temporarily resolved as Awaiting Response. It will automatically reopen when you add information. Please follow the format shown and include all sections (steps, observed, expected). Reports that do not contain all of the requested information and complete steps to reproduce the issue may be closed as Incomplete. For more information please read the Bug Tracker Guidelines.

You may find this Report Creation Form helpful for any future reports you create.

Thank you for your report!

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

Could you please attach an example behavior pack with which the issue can be observed?

This ticket will automatically reopen when you reply.

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

If this is still an issue in the latest release, please update your script to use one of the stable versions of the API, so that we don't manually have to update the API version every time a new update is released.

Also, the .mcpack you've provided doesn't work and throws errors, so please fix it if this is still a valid issue.

Harald Scharf

(Unassigned)

Unconfirmed

Multiple

Script-API

1.20.0

Retrieved