Record Class EntityDataSource

java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.EntityDataSource
All Implemented Interfaces:
DataSource

public record EntityDataSource(String selectorPattern, @Nullable EntitySelector compiledSelector) extends Record implements DataSource
  • Field Details Link icon

    • selectorPattern Link icon

      private final String selectorPattern
      The field for the selectorPattern record component.
    • compiledSelector Link icon

      @Nullable private final EntitySelector compiledSelector
      The field for the compiledSelector record component.
    • SUB_CODEC Link icon

      public static final com.mojang.serialization.MapCodec<EntityDataSource> SUB_CODEC
    • TYPE Link icon

      public static final DataSource.Type<EntityDataSource> TYPE
  • Constructor Details Link icon

    • EntityDataSource Link icon

      public EntityDataSource(String p_237330_)
    • EntityDataSource Link icon

      public EntityDataSource(String selectorPattern, @Nullable EntitySelector compiledSelector)
      Creates an instance of a EntityDataSource record class.
      Parameters:
      selectorPattern - the value for the selectorPattern record component
      compiledSelector - the value for the compiledSelector record component
  • Method Details Link icon

    • compileSelector Link icon

      @Nullable private static EntitySelector compileSelector(String p_237336_)
    • getData Link icon

      public Stream<CompoundTag> getData(CommandSourceStack p_237341_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      getData in interface DataSource
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • type Link icon

      public DataSource.Type<?> type()
      Specified by:
      type in interface DataSource
    • toString Link icon

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • equals Link icon

      public boolean equals(Object p_237339_)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      p_237339_ - the object with which to compare
      Returns:
      true if this object is the same as the p_237339_ argument; false otherwise.
    • hashCode Link icon

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • selectorPattern Link icon

      public String selectorPattern()
      Returns the value of the selectorPattern record component.
      Returns:
      the value of the selectorPattern record component
    • compiledSelector Link icon

      @Nullable public EntitySelector compiledSelector()
      Returns the value of the compiledSelector record component.
      Returns:
      the value of the compiledSelector record component