mojira.dev
MCPE-111849

The sorting of entities invoking a function in certain circumstances is in reverse order

The bug

When several entities call a function within another function, the selected order of entities is in reverse order. Selectors should have consistent sorting—that is, from nearest to furthest.

Steps to reproduce:

  • Open the provided world, stand near one of the sets of stairs, and run /function sort_entities.

  • Observe the results. The chat will print the following: a regular /tellraw message listing the three entities by name; each entity will call a function that prints their own name in chat; and each entity will print their name in chat without calling a function.
    The expected behavior is all three should sort the entities the same way, but the "With function:" line prints the entities in reverse order.

(Note that this problem does not occur if the same command within the "sort_entities" function is called directly in chat.)

/execute @e[type=bug:sample_entity] ~ ~ ~ function print_name

If the list of entities was 1, 2, and 3, the results should print this:

[media]

Attachments

Comments 1

Updated the ticket to more accurately describe the bug.

Sprunkles

(Unassigned)

532449

Confirmed

Windows

commands, function, selector, sort

1.17.10.21 Beta, 1.17.10.20 Beta, 1.17.0.58 Beta, 1.17.0.56 Beta, 1.16.220, 1.16.201 Hotfix, 1.16.221 Hotfix

1.18.0.20 Beta, 1.18.0

Retrieved