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

Can node graphs have cycles? #105

Open
Pharap opened this issue Nov 9, 2021 · 1 comment
Open

Can node graphs have cycles? #105

Pharap opened this issue Nov 9, 2021 · 1 comment

Comments

@Pharap
Copy link

Pharap commented Nov 9, 2021

I was reading the Minecraft Wiki article about Brigadier which states:

/execute run redirects to the root node of the vanilla command dispatcher

Which implies that the command 'tree' can have cycles (which would mean that it's technically not a tree, which must be acyclic, but in in fact a rooted unidirected graph).

So I just wanted to clarify whether or not what the Wiki claims is correct, and whether it is technically possible for node graphs to have cycles (perhaps even back to the root node) or whether Minecraft does something special to achieve execute's recursive/cyclic functionality.

(If that's the case, it may be worth clarifying this in the README.md.)

@Pokechu22
Copy link

https://wiki.vg/Command_Data says:

When including redirects, this structure is a directed graph that may include cycles (e.g. consider /execute run execute run execute ...). When excluding redirects, the structure no longer contains cycles but may still not be a tree, as a node may have multiple parents.

This image (PNG, 1.5 MB, 2179 by 14448 - mobile users avoid this) from 18w22c indicates redirects with a dashed line and normal children with a solid line.

Note that wiki.vg is documenting the format used over the network protocol, which may be slightly different from what you expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants