We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

2

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

1 Comments

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.