Record Class EntityDataSource
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.data.EntityDataSource
- All Implemented Interfaces:
DataSource
public record EntityDataSource(CompilableString<EntitySelector> selector)
extends Record
implements DataSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodec<EntityDataSource> private final CompilableString<EntitySelector> The field for theselectorrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntityDataSource(CompilableString<EntitySelector> selector) Creates an instance of aEntityDataSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()final booleanIndicates whether some other object is "equal to" this one.getData(CommandSourceStack sender) final inthashCode()Returns a hash code value for this object.selector()Returns the value of theselectorrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
selector
The field for theselectorrecord component. -
MAP_CODEC
-
-
Constructor Details
-
EntityDataSource
Creates an instance of aEntityDataSourcerecord class.- Parameters:
selector- the value for theselectorrecord component
-
-
Method Details
-
getData
- Specified by:
getDatain interfaceDataSource- Throws:
CommandSyntaxException
-
codec
- Specified by:
codecin interfaceDataSource
-
toString
-
hashCode
-
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). -
selector
Returns the value of theselectorrecord component.- Returns:
- the value of the
selectorrecord component
-