mojira.dev
MCPE-126911

Commands with Certain Target Selectors in an Mcfunction Files Only Run When Manually Called

In an mcfunction file, if you have a command (such as the one I tried to use, kill @a[x=2500,dx=100]) with certain target selectors (which I think are at least dx dy and dz), this command will only run in the function when /function is called in-game, and not from tick.json or called by other functions called by tick.json.
I have proof that this is not my bug because if I call the function manually with /function everything works as intended but if tick.json calls it everything works as intended except these certain lines. I have also tried other commands, which all seem to be affected, and other target selectors, which don't seem to be affected.
Steps to Reproduce:

Create a minecraft behavior pack with a func.mcfunction file in BP/functions/:

tp @a 0 250 0

scoreboard objectives new time dummy Time

scoreboard objectives setdisplay sidebar time

scoreboard players add @a time 1

kill @a[x=-10,dx=20]

and tick.json in the same directory:
{{"values": [ "func"]}

and then apply this behavior pack to a world and notice how the time on the side goes up but you aren't killed, but if you type the command /function func then it kills you.

Comments 6

Is this an ongoing issue in the latest version (1.17.2)? If so, can you please add it to the affected versions (or mention it if you are not the reporter).
This ticket will automatically reopen when you reply.

ok I will but it should be updated automatically because there was a minecraft update. I literally made this ticket 2 months ago

 

it does affect this version but I cant figure out how to add it to the affected versions can you please

Is this still an issue in the latest version?

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

For any account or purchasing related issues, please contact Minecraft Customer Support directly, as we cannot assist with those here at the bug tracker.

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

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

For any account or purchasing related issues, please contact Minecraft Customer Support directly, as we cannot assist with those here at the bug tracker.

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

Miles Caprio

(Unassigned)

Unconfirmed

Windows

1.16.221 Hotfix

Retrieved