Package net.minecraft.commands.functions
Record Class PlainTextFunction<T>
java.lang.Object
java.lang.Record
net.minecraft.commands.functions.PlainTextFunction<T>
- All Implemented Interfaces:
CommandFunction<T>
,InstantiatedFunction<T>
public record PlainTextFunction<T>(ResourceLocation id, List<UnboundEntryAction<T>> entries)
extends Record
implements CommandFunction<T>, InstantiatedFunction<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<UnboundEntryAction<T>>
The field for theentries
record component.private final ResourceLocation
The field for theid
record component. -
Constructor Summary
ConstructorDescriptionPlainTextFunction
(ResourceLocation id, List<UnboundEntryAction<T>> entries) Creates an instance of aPlainTextFunction
record class. -
Method Summary
Modifier and TypeMethodDescriptionentries()
Returns the value of theentries
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.instantiate
(CompoundTag p_311629_, com.mojang.brigadier.CommandDispatcher<T> p_311161_, T p_313022_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
id
The field for theid
record component. -
entries
The field for theentries
record component.
-
-
Constructor Details
-
PlainTextFunction
Creates an instance of aPlainTextFunction
record class.- Parameters:
id
- the value for theid
record componententries
- the value for theentries
record component
-
-
Method Details
-
instantiate
public InstantiatedFunction<T> instantiate(@Nullable CompoundTag p_311629_, com.mojang.brigadier.CommandDispatcher<T> p_311161_, T p_313022_) throws FunctionInstantiationException - Specified by:
instantiate
in interfaceCommandFunction<T>
- Throws:
FunctionInstantiationException
-
id
Returns the value of theid
record component.- Specified by:
id
in interfaceCommandFunction<T>
- Specified by:
id
in interfaceInstantiatedFunction<T>
- Returns:
- the value of the
id
record component
-
entries
Returns the value of theentries
record component.- Specified by:
entries
in interfaceInstantiatedFunction<T>
- Returns:
- the value of the
entries
record component
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code 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)
.
-