[GH-ISSUE #7794] Negated missing selector predicates incorrectly select entities #3371

Open
opened 2026-11-03 04:07:52 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @TheMrZZ on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7794

Originally assigned to: @TheMrZZ on GitHub.

🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

An entity selector using a missing named predicate currently accepts entities when that predicate is negated. Java Edition 26.3 rejects the selector for both signs when the resource cannot be found.

In a loaded area with ticks frozen, summon a uniquely tagged sheep with NoAI:1b,NoGravity:1b, wait until it is selectable, then run:

execute if entity @e[tag=selector_probe,predicate=h124_missing_873b04b1:absent]
execute if entity @e[tag=selector_probe,predicate=!h124_missing_873b04b1:absent]

Java rejects both; Horizon selects the sheep for the second command. The namespace is deliberately fresh so the resource is absent.

Official 26.3 EntitySelectorOptions.lambda$bootStrap$56 checks the registry lookup's empty Optional and returns false before applying negation. game/scoreboard.rs instead turns absence into false using is_some_and, then compares that result to the negation flag.

Scope is missing lookup versus negation. Defined-predicate controls will use qualified minecraft:entity_type data, without changing namespace handling, reference evaluation, random chance, weather conditions or component views.

Originally created by @TheMrZZ on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7794 Originally assigned to: @TheMrZZ on GitHub. > 🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. An entity selector using a missing named predicate currently accepts entities when that predicate is negated. Java Edition 26.3 rejects the selector for both signs when the resource cannot be found. In a loaded area with ticks frozen, summon a uniquely tagged sheep with `NoAI:1b,NoGravity:1b`, wait until it is selectable, then run: ```mcfunction execute if entity @e[tag=selector_probe,predicate=h124_missing_873b04b1:absent] execute if entity @e[tag=selector_probe,predicate=!h124_missing_873b04b1:absent] ``` Java rejects both; Horizon selects the sheep for the second command. The namespace is deliberately fresh so the resource is absent. Official 26.3 `EntitySelectorOptions.lambda$bootStrap$56` checks the registry lookup's empty Optional and returns false before applying negation. `game/scoreboard.rs` instead turns absence into `false` using `is_some_and`, then compares that result to the negation flag. Scope is missing lookup versus negation. Defined-predicate controls will use qualified `minecraft:entity_type` data, without changing namespace handling, reference evaluation, random chance, weather conditions or component views.
Author
Owner

@TheMrZZ commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6588280477 --> @TheMrZZ commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3371
No description provided.