Mojira Archive
MCPE-170001

play_effect and play_sound block event responses do not work.

Block and item events have been removed. Use Custom Components instead

play_sound and play_effect block event responses do not work. play_sound does not play the sound to the player who interacted with the block and play_effect does not spawn particles at the position of the target.

 

{
 "events": {
  "on_interact": {
    "play_effect": {
       "data": 0,
        "effect": "minecraft:candle_flame_particle",
        "target": "self"
    },
    "play_sound": {
        "sound": "random.click",
         "target": "self"
     }
  }
 }
}

 

Steps to Reproduce:

  1. Download the example addon below
  2. Install it how you would install all other addons (click on it for Windows 10)
  3. Create a new world
  4. Make sure experimental gameplay is turned on. (Holiday features)
  5. Activate the behavior pack
  6. Finish creating your world
  7. Place "bug:play_effect" and "bug:play_sound" blocks on the ground from the creative inventory.
  8. Right-click on the placed blocks.

Observed Results:

  • Clicking on bug:play_effect does not spawn any particles
  • Clicking on bug:play_sound does not play any sounds.
  • Both blocks print "I triggered on_interact event!" in chat showing that the event is properly triggering.

Expected Results:

  • Clicking on bug:play_effect will spawn the defined particle like the /particle command
  • Clicking on bug:play_sound will play the defined sound to the player like the /playsound command

Other Notes

  • According to the Microsoft docs "target" can use Minecraft Filters. but throws an error if you do use an object-like filter.
"play_sound":{
    "sound" : "jumpscare",
    "target" : {"test": "random_chance", "value": "2"} // Causes error. only excepts enums
} 

Won't Fix

Legopitstop

2023-04-27, 09:07 PM

2025-01-09, 07:21 PM

2025-01-09, 07:21 PM

4

4

Confirmed

1038034

1.19.80, 1.20.71 Hotfix

-