Interface INbtPathExpression

All Known Implementing Classes:
NbtPathExpressionList, NbtPathExpressionParseHandlerAllChildren.Expression, NbtPathExpressionParseHandlerBooleanRelationalAdapter.Expression, NbtPathExpressionParseHandlerChild.Expression, NbtPathExpressionParseHandlerCurrent.Expression, NbtPathExpressionParseHandlerFilterExpression.Expression, NbtPathExpressionParseHandlerLength.Expression, NbtPathExpressionParseHandlerListElement.Expression, NbtPathExpressionParseHandlerListSlice.Expression, NbtPathExpressionParseHandlerParent.Expression, NbtPathExpressionParseHandlerRoot.Expression, NbtPathExpressionParseHandlerStringEqual.Expression, NbtPathExpressionParseHandlerUnion.Expression

public interface INbtPathExpression
A parsed NBT path expression.
  • Method Details

    • match

      default NbtPathExpressionMatches match(Stream<net.minecraft.nbt.Tag> nbts)
      Find all matches for the given stream of NBT tags.
      Parameters:
      nbts - A stream of NBT tags.
      Returns:
      The matches.
    • match

      default NbtPathExpressionMatches match(net.minecraft.nbt.Tag nbt)
      Find all matches for the given NBT tag.
      Parameters:
      nbt - An NBT tag.
      Returns:
      The matches.
    • test

      default boolean test(Stream<net.minecraft.nbt.Tag> nbts)
      Test if any of the given NBT tags in the given stream match with the expression.
      Parameters:
      nbts - A stream of NBT tags.
      Returns:
      True if there is at least one match.
    • test

      default boolean test(net.minecraft.nbt.Tag nbt)
      Test if the given NBT tag matches with the expression.
      Parameters:
      nbt - An NBT tag.
      Returns:
      True if there is at least one match.
    • matchContexts

      Find all matches for the given stream of NBT tags.
      Parameters:
      executionContexts - A stream of NBT execution contexts.
      Returns:
      The matches.
    • asNavigation

      default INbtPathNavigation asNavigation(@Nullable INbtPathNavigation child) throws NbtParseException
      Create a navigation for this expression with the given navigation as child. If no child is passed, the created navigation is a leaf.
      Parameters:
      child - An option child.
      Returns:
      A navigation path.
      Throws:
      NbtParseException - If this expression can not be expressed as a navigation.
    • asNavigation

      default INbtPathNavigation asNavigation() throws NbtParseException
      Create a navigation for this expression.
      Returns:
      A navigation path.
      Throws:
      NbtParseException - If this expression can not be expressed as a navigation.