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
Modifier and TypeFieldDescriptionprivate final EntitySelector
The field for thecompiledSelector
record component.private final String
The field for theselectorPattern
record 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
ConstructorDescriptionEntityDataSource
(String p_237330_) EntityDataSource
(String selectorPattern, EntitySelector compiledSelector) Creates an instance of aEntityDataSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompiledSelector
record component.private static EntitySelector
compileSelector
(String p_237336_) boolean
Indicates whether some other object is "equal to" this one.getData
(CommandSourceStack p_237341_) int
hashCode()
Returns a hash code value for this object.Returns the value of theselectorPattern
record component.toString()
Returns a string representation of this record class.type()
-
Field Details
-
selectorPattern
The field for theselectorPattern
record component. -
compiledSelector
The field for thecompiledSelector
record component. -
SUB_CODEC
-
TYPE
-
-
Constructor Details
-
EntityDataSource
-
EntityDataSource
Creates an instance of aEntityDataSource
record class.- Parameters:
selectorPattern
- the value for theselectorPattern
record componentcompiledSelector
- the value for thecompiledSelector
record component
-
-
Method Details
-
compileSelector
-
getData
public Stream<CompoundTag> getData(CommandSourceStack p_237341_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getData
in interfaceDataSource
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
type
- Specified by:
type
in 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 theselectorPattern
record component.- Returns:
- the value of the
selectorPattern
record component
-
compiledSelector
Returns the value of thecompiledSelector
record component.- Returns:
- the value of the
compiledSelector
record component
-