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
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.chat.contents.DataSource
DataSource.Type<T extends DataSource> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EntitySelectorThe field for thecompiledSelectorrecord component.private final StringThe field for theselectorPatternrecord component.static final com.mojang.serialization.MapCodec<EntityDataSource> static final DataSource.Type<EntityDataSource> Fields inherited from interface net.minecraft.network.chat.contents.DataSource
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionEntityDataSource(String p_237330_) EntityDataSource(String selectorPattern, EntitySelector compiledSelector) Creates an instance of aEntityDataSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompiledSelectorrecord component.private static EntitySelectorcompileSelector(String p_237336_) booleanIndicates whether some other object is "equal to" this one.getData(CommandSourceStack p_237341_) inthashCode()Returns a hash code value for this object.Returns the value of theselectorPatternrecord component.toString()Returns a string representation of this record class.type()
-
Field Details
-
selectorPattern
The field for theselectorPatternrecord component. -
compiledSelector
The field for thecompiledSelectorrecord component. -
SUB_CODEC
-
TYPE
-
-
Constructor Details
-
EntityDataSource
-
EntityDataSource
Creates an instance of aEntityDataSourcerecord class.- Parameters:
selectorPattern- the value for theselectorPatternrecord componentcompiledSelector- the value for thecompiledSelectorrecord component
-
-
Method Details
-
compileSelector
-
getData
public Stream<CompoundTag> getData(CommandSourceStack p_237341_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getDatain interfaceDataSource- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
type
- Specified by:
typein interfaceDataSource
-
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. -
equals
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 withObjects::equals(Object,Object). -
hashCode
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. -
selectorPattern
Returns the value of theselectorPatternrecord component.- Returns:
- the value of the
selectorPatternrecord component
-
compiledSelector
Returns the value of thecompiledSelectorrecord component.- Returns:
- the value of the
compiledSelectorrecord component
-