mojira.dev
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
}

Attachments

Comments 1

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behaviour, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

If you'd like to post a suggestion or give further feedback, please visit the Minecraft Feedback Site or choose a link below.

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

Legopitstop

(Unassigned)

1038034

Confirmed

Windows

Multiple

1.19.80, 1.20.71 Hotfix

Retrieved