mojira.dev
MCPE-39785

Function position refers to executor instead of command origin when not using /execute

The bug

The following commands are supposed to be indistinguishable:

/function cmd
/execute @s ~ ~ ~ function cmd

However, this is not the case for some functions.
Consider the following function:

tp @s ~ ~5 ~
setblock ~ ~ ~ stone

The expected behavior this function is that you are teleported 5 blocks up, then stone is placed on the ground where you used to be. If this seems confusing, please understand that relative coordinates are relative to the position the command was run from, not the position of @s. This is well-established and works correctly in many other situations.

The function works differently depending on if you put /execute @s ~ ~ ~ in front of it, breaking the first assumption. With the /execute, it works correctly, but without it, it fails, teleporting the player ten blocks in the air.

How to reproduce

1. Download and open the attached world

2. /execute @s ~ ~ ~ function teleport_block
→ ✔ The block was placed on the ground
3. /function teleport_test
→ ❌ The block was placed in mid-air

Linked issues

Attachments

Comments

tryashtar

Did some testing myself and I can confirm this issue. I have changed the examples a bit to make it easier to understand the actual problem, hope you are okay with that

tryashtar

As of 1.10, the first example is fixed, but the second is not.

[Mojang] Mega_Spud (Jay)

Cleaning up old tickets: This ticket has not been updated recently (~1 year+) so is being closed as Cannot Reproduce. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines.

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

tryashtar

The second example is still an issue

[Mojang] Mega_Spud (Jay)

Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response

Is this still an issue in the latest version? If so, please add a comment or update the affected version field.

To make your bug report as effective as possible, please try and include the following steps to reproduce the problem:

Steps to Reproduce:
1.
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

If your ticket does not look like the example given here, then it's likely to be closed as incomplete.

This ticket will automatically reopen when you reply.

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

tryashtar

Still an issue

[Mod] OcelotOnesie

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryFeature Requests and Suggestions

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Nusiq

(Unassigned)

166539

Confirmed

Windows

vanilla-parity

1.13.0.1 Beta, 1.19.10.20 Preview, 1.17.40.23 Beta, 1.17.40.21 Beta, 1.17.30.22 Beta, ..., 1.13.0, 1.16.100, 1.16.101 Hotfix, 1.17.30, 1.17.32

Retrieved