Package net.minecraft.server.commands
Record Class LookAt.LookAtEntity
java.lang.Object
java.lang.Record
net.minecraft.server.commands.LookAt.LookAtEntity
- All Implemented Interfaces:
LookAt
- Enclosing interface:
LookAt
public static record LookAt.LookAtEntity(Entity entity, EntityAnchorArgument.Anchor anchor)
extends Record
implements LookAt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.commands.LookAt
LookAt.LookAtEntity, LookAt.LookAtPosition
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EntityAnchorArgument.Anchor
The field for theanchor
record component.private final Entity
The field for theentity
record component. -
Constructor Summary
ConstructorsConstructorDescriptionLookAtEntity
(Entity entity, EntityAnchorArgument.Anchor anchor) Creates an instance of aLookAtEntity
record class. -
Method Summary
Modifier and TypeMethodDescriptionanchor()
Returns the value of theanchor
record component.entity()
Returns the value of theentity
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.void
perform
(CommandSourceStack p_380255_, Entity p_379889_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
entity
The field for theentity
record component. -
anchor
The field for theanchor
record component.
-
-
Constructor Details
-
LookAtEntity
Creates an instance of aLookAtEntity
record class.- Parameters:
entity
- the value for theentity
record componentanchor
- the value for theanchor
record component
-
-
Method Details
-
perform
-
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)
. -
entity
Returns the value of theentity
record component.- Returns:
- the value of the
entity
record component
-
anchor
Returns the value of theanchor
record component.- Returns:
- the value of the
anchor
record component
-