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 SummaryNested classes/interfaces inherited from interface net.minecraft.network.chat.contents.DataSourceDataSource.Type<T extends DataSource>
- 
Field SummaryFieldsModifier 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.DataSourceCODEC
- 
Constructor SummaryConstructorsConstructorDescriptionEntityDataSource(String p_237330_) EntityDataSource(String selectorPattern, EntitySelector compiledSelector) Creates an instance of aEntityDataSourcerecord class.
- 
Method SummaryModifier 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- 
selectorPatternThe field for theselectorPatternrecord component.
- 
compiledSelectorThe field for thecompiledSelectorrecord component.
- 
SUB_CODEC
- 
TYPE
 
- 
- 
Constructor Details- 
EntityDataSource
- 
EntityDataSourceCreates an instance of aEntityDataSourcerecord class.- Parameters:
- selectorPattern- the value for the- selectorPatternrecord component
- compiledSelector- the value for the- compiledSelectorrecord component
 
 
- 
- 
Method Details- 
compileSelector
- 
getDatapublic Stream<CompoundTag> getData(CommandSourceStack p_237341_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
- getDatain interface- DataSource
- Throws:
- com.mojang.brigadier.exceptions.CommandSyntaxException
 
- 
type- Specified by:
- typein interface- DataSource
 
- 
toStringReturns 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.
- 
equalsIndicates 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).
- 
hashCodepublic int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
selectorPatternReturns the value of theselectorPatternrecord component.- Returns:
- the value of the selectorPatternrecord component
 
- 
compiledSelectorReturns the value of thecompiledSelectorrecord component.- Returns:
- the value of the compiledSelectorrecord component
 
 
-