Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show /execute syntax to play data packs from a command block #334

Closed
Oscilloscopy opened this issue Jun 16, 2022 · 2 comments
Closed

Show /execute syntax to play data packs from a command block #334

Oscilloscopy opened this issue Jun 16, 2022 · 2 comments
Labels
C: Enhancement New feature or request S: Resolved in next release This bugfix or suggestion has been applied to the code
Milestone

Comments

@Oscilloscopy
Copy link

This could be an issue for mapmakers and other similar people, if the function were to be run on a command block, using /function or doing the same with /execute on a player doesnt play because the datapack uses @s in the play/pause/stop commands. Maybe add a feature to change this to @p/@a/etc.

@encode42
Copy link
Member

From the FAQ:

🇶 I can't hear my data pack when I play it in a command block./How can I play data packs to everyone in the world?
When you run /function <song>:play in the chat, you're the one executing the command, so the datapack will only play for you. Similarly, if you paste this command into a command block, the song will only play for the command block itself, that is, no one will hear it. To play the song for everyone, use /execute as @a at @s run function <song>:play. You can also replace @a with another selector to pick whoever you want to hear the song.

@Bentroen
Copy link
Member

Bentroen commented Jun 20, 2022

Yeah, the purpose of using @s is so the command executor has the freedom to pick who they want to hear the song, which is possible with /execute (wouldn't be the case if @p/@A were "baked" into the commands).

Playing from a command block is such a common use case, though. So I do think we should make it more clear that this is the intended way to use the data pack (perhaps by showing the /execute syntax on the popup after you export the data pack). I'll leave this issue open so we can address it in the future!

@Bentroen Bentroen added the C: Enhancement New feature or request label Jun 20, 2022
@Bentroen Bentroen changed the title Support for command blocks Show /execute syntax to play data packs from a command block Jun 20, 2022
@Bentroen Bentroen added this to the v3.x milestone Jun 2, 2023
@Bentroen Bentroen added the S: Resolved in next release This bugfix or suggestion has been applied to the code label Apr 4, 2024
@Bentroen Bentroen modified the milestones: v3.x, v3.10.1 Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Enhancement New feature or request S: Resolved in next release This bugfix or suggestion has been applied to the code
Projects
None yet
Development

No branches or pull requests

3 participants