Package net.minecraft.world.entity
Record Class ItemOwner.OffsetFromOwner
java.lang.Object
java.lang.Record
net.minecraft.world.entity.ItemOwner.OffsetFromOwner
- All Implemented Interfaces:
ItemOwner
- Enclosing interface:
ItemOwner
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.entity.ItemOwner
ItemOwner.OffsetFromOwner -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOffsetFromOwner(ItemOwner owner, Vec3 offset) Creates an instance of aOffsetFromOwnerrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable LivingEntityfinal booleanIndicates whether some other object is "equal to" this one.floatfinal inthashCode()Returns a hash code value for this object.level()offset()Returns the value of theoffsetrecord component.owner()Returns the value of theownerrecord component.position()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
owner
The field for theownerrecord component. -
offset
The field for theoffsetrecord component.
-
-
Constructor Details
-
OffsetFromOwner
Creates an instance of aOffsetFromOwnerrecord class.- Parameters:
owner- the value for theownerrecord componentoffset- the value for theoffsetrecord component
-
-
Method Details
-
level
-
position
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Specified by:
getVisualRotationYInDegreesin interfaceItemOwner
-
asLivingEntity
- Specified by:
asLivingEntityin interfaceItemOwner
-
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). -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-