Sign in
Skip to main content

Commands let players perform actions and customize gameplay using text-based instructions. Use this topic to share feedback and ideas for improving commands and related tools.

2

Enable /data get to obtain a value using both NBT path and number in order

1 Comments

Post a new comment:

Please sign in to leave a comment.

Sorted by oldest
  • 1
    Registered User commented
    Comment actions Permalink

    I feel like there's missing functionality with array subscripting in NBT paths. You should be able to define compound tag predicates at array subscripts like:

    data get <source-profile> Foo[0]{Bar:"Baz"}.Bar

    This will access the first index's Bar tag of the Foo compound array only if it matches the contents of the compound predicate.

    However, this will not try to "find" the first available element, instead it really just operates on the "first index" only. Still, there are ways to filter out a number of elements of an array though.