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

Entity Selection In Datapacks Breaks #757

Closed
redstonerblast opened this issue Jun 16, 2024 · 1 comment
Closed

Entity Selection In Datapacks Breaks #757

redstonerblast opened this issue Jun 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@redstonerblast
Copy link

Issue: Selecting command entities (such as markers) via tags doesn't work

Versions: Origins 1.13.0-alpha.2 & Origins 1.13.0-alpha.3

Example:

summon marker ~ ~ ~ {Tags:["sapling"]}
execute as @e[type=marker,tag=sapling] run say hi
@eggohito eggohito added bug Something isn't working MC: 1.20.4 and removed MC: 1.20.4 labels Jun 17, 2024
@eggohito
Copy link
Collaborator

eggohito commented Jun 17, 2024

Assuming that the commands are run in a function (or anywhere else that allows executing commands in bulk), I think this happens because the implemented data tracker for command tags (which also effectively replace the command tags of the entity when queried) is only updated at the end of the tick.

Since commands in a function are executed in a single tick, it would seem that the entity wouldn't have the tag(s) by the point the target selector starts selecting entities, hence the issue. Good catch!

eggohito added a commit to apace100/apoli that referenced this issue Jun 19, 2024
The previous implementation had an optimization where the data tracker for command tags were only set after the end of the tick, which caused the issue. It has been removed not only to fix the issue, but also because it was unnecessary as it's already being done by the data trackers themselves

Resolves apace100/origins-fabric#757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants