Package net.minecraft.server.commands
Record Class TeleportCommand.LookAtPosition
java.lang.Object
java.lang.Record
net.minecraft.server.commands.TeleportCommand.LookAtPosition
- All Implemented Interfaces:
TeleportCommand.LookAt
- Enclosing class:
TeleportCommand
static record TeleportCommand.LookAtPosition(Vec3 position)
extends Record
implements TeleportCommand.LookAt
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLookAtPosition
(Vec3 position) Creates an instance of aLookAtPosition
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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_326870_, Entity p_326894_) position()
Returns the value of theposition
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
position
The field for theposition
record component.
-
-
Constructor Details
-
LookAtPosition
LookAtPosition(Vec3 position) Creates an instance of aLookAtPosition
record class.- Parameters:
position
- the value for theposition
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)
. -
position
Returns the value of theposition
record component.- Returns:
- the value of the
position
record component
-