Package net.minecraft.server.commands
Record Class TeleportCommand.LookAtEntity
java.lang.Object
java.lang.Record
net.minecraft.server.commands.TeleportCommand.LookAtEntity
- All Implemented Interfaces:
TeleportCommand.LookAt
- Enclosing class:
TeleportCommand
static record TeleportCommand.LookAtEntity(Entity entity, EntityAnchorArgument.Anchor anchor)
extends Record
implements TeleportCommand.LookAt
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EntityAnchorArgument.Anchor
The field for theanchor
record component.private final Entity
The field for theentity
record component. -
Constructor Summary
ConstructorDescriptionLookAtEntity
(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_326864_, Entity p_326807_) 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
LookAtEntity(Entity entity, EntityAnchorArgument.Anchor anchor) Creates an instance of aLookAtEntity
record class.- Parameters:
entity
- the value for theentity
record componentanchor
- the value for theanchor
record component
-
-
Method Details
-
perform
- Specified by:
perform
in interfaceTeleportCommand.LookAt
-
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
-