apace100 / origins-fabric

MIT License
175 stars 173 forks source link

Entity Selection In Datapacks Breaks #757

Closed redstonerblast closed 3 months ago

redstonerblast commented 3 months ago

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 commented 3 months ago

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!