Record Class PlayerEntity.SleepFailureReason

java.lang.Object
java.lang.Record
net.minecraft.entity.player.PlayerEntity.SleepFailureReason
Record Components:
message -
Enclosing class:
PlayerEntity

public static record PlayerEntity.SleepFailureReason(@Nullable Text message) extends Record
A reason why a player cannot start sleeping.
Mappings:
Namespace Name
named net/minecraft/entity/player/PlayerEntity$SleepFailureReason
intermediary net/minecraft/class_1657$class_1658
official dcc$a
named message
intermediary comp_5144
official e
  • Field Details

    • message

      @Nullable private final @Nullable Text message
      The field for the message record component.
    • TOO_FAR_AWAY

      public static final PlayerEntity.SleepFailureReason TOO_FAR_AWAY
      Mappings:
      Namespace Name Mixin selector
      named TOO_FAR_AWAY Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;TOO_FAR_AWAY:Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;
      intermediary field_7530 Lnet/minecraft/class_1657$class_1658;field_7530:Lnet/minecraft/class_1657$class_1658;
      official a Ldcc$a;a:Ldcc$a;
    • OBSTRUCTED

      public static final PlayerEntity.SleepFailureReason OBSTRUCTED
      Mappings:
      Namespace Name Mixin selector
      named OBSTRUCTED Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;OBSTRUCTED:Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;
      intermediary field_18592 Lnet/minecraft/class_1657$class_1658;field_18592:Lnet/minecraft/class_1657$class_1658;
      official b Ldcc$a;b:Ldcc$a;
    • OTHER

      public static final PlayerEntity.SleepFailureReason OTHER
      Mappings:
      Namespace Name Mixin selector
      named OTHER Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;OTHER:Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;
      intermediary field_7531 Lnet/minecraft/class_1657$class_1658;field_7531:Lnet/minecraft/class_1657$class_1658;
      official c Ldcc$a;c:Ldcc$a;
    • NOT_SAFE

      public static final PlayerEntity.SleepFailureReason NOT_SAFE
      Mappings:
      Namespace Name Mixin selector
      named NOT_SAFE Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;NOT_SAFE:Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;
      intermediary field_7532 Lnet/minecraft/class_1657$class_1658;field_7532:Lnet/minecraft/class_1657$class_1658;
      official d Ldcc$a;d:Ldcc$a;
  • Constructor Details

    • SleepFailureReason

      public SleepFailureReason(@Nullable @Nullable Text message)
      Creates an instance of a SleepFailureReason record class.
      Parameters:
      message - the value for the message record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • message

      @Nullable public @Nullable Text message()
      Returns the action bar message that is sent to the player when sleeping fails with this reason.
      Returns:
      the message, or null if none is sent for this reason
      Mappings:
      Namespace Name Mixin selector
      named message Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;message()Lnet/minecraft/text/Text;
      intermediary comp_5144 Lnet/minecraft/class_1657$class_1658;comp_5144()Lnet/minecraft/class_2561;
      official a Ldcc$a;a()Lym;