Record Class BedRule

java.lang.Object
java.lang.Record
net.minecraft.world.attribute.BedRule
Record Components:
canSleep -
canSetSpawn -
explodes -
errorMessage -

public record BedRule(BedRule.Condition canSleep, BedRule.Condition canSetSpawn, boolean explodes, Optional<Text> errorMessage) extends Record
Mappings:
Namespace Name
named net/minecraft/world/attribute/BedRule
intermediary net/minecraft/class_12195
official cdx
named canSleep
intermediary comp_5136
official d
named canSetSpawn
intermediary comp_5137
official e
named explodes
intermediary comp_5138
official f
named errorMessage
intermediary comp_5139
official g
  • Field Details

    • canSleep

      private final BedRule.Condition canSleep
      The field for the canSleep record component.
    • canSetSpawn

      private final BedRule.Condition canSetSpawn
      The field for the canSetSpawn record component.
    • explodes

      private final boolean explodes
      The field for the explodes record component.
    • errorMessage

      private final Optional<Text> errorMessage
      The field for the errorMessage record component.
    • OVERWORLD

      public static final BedRule OVERWORLD
      Mappings:
      Namespace Name Mixin selector
      named OVERWORLD Lnet/minecraft/world/attribute/BedRule;OVERWORLD:Lnet/minecraft/world/attribute/BedRule;
      intermediary field_63703 Lnet/minecraft/class_12195;field_63703:Lnet/minecraft/class_12195;
      official a Lcdx;a:Lcdx;
    • OTHER_DIMENSION

      public static final BedRule OTHER_DIMENSION
      Mappings:
      Namespace Name Mixin selector
      named OTHER_DIMENSION Lnet/minecraft/world/attribute/BedRule;OTHER_DIMENSION:Lnet/minecraft/world/attribute/BedRule;
      intermediary field_63704 Lnet/minecraft/class_12195;field_63704:Lnet/minecraft/class_12195;
      official b Lcdx;b:Lcdx;
    • CODEC

      public static final com.mojang.serialization.Codec<BedRule> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/world/attribute/BedRule;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_63705 Lnet/minecraft/class_12195;field_63705:Lcom/mojang/serialization/Codec;
      official c Lcdx;c:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • BedRule

      public BedRule(BedRule.Condition canSleep, BedRule.Condition canSetSpawn, boolean explodes, Optional<Text> errorMessage)
      Creates an instance of a BedRule record class.
      Parameters:
      canSleep - the value for the canSleep record component
      canSetSpawn - the value for the canSetSpawn record component
      explodes - the value for the explodes record component
      errorMessage - the value for the errorMessage record component
  • Method Details

    • canSleep

      public boolean canSleep(World world)
      Mappings:
      Namespace Name Mixin selector
      named canSleep Lnet/minecraft/world/attribute/BedRule;canSleep(Lnet/minecraft/world/World;)Z
      intermediary method_75643 Lnet/minecraft/class_12195;method_75643(Lnet/minecraft/class_1937;)Z
      official a Lcdx;a(Ldvg;)Z
    • canSetSpawn

      public boolean canSetSpawn(World world)
      Mappings:
      Namespace Name Mixin selector
      named canSetSpawn Lnet/minecraft/world/attribute/BedRule;canSetSpawn(Lnet/minecraft/world/World;)Z
      intermediary method_75644 Lnet/minecraft/class_12195;method_75644(Lnet/minecraft/class_1937;)Z
      official b Lcdx;b(Ldvg;)Z
    • getFailureReason

      public PlayerEntity.SleepFailureReason getFailureReason()
      Mappings:
      Namespace Name Mixin selector
      named getFailureReason Lnet/minecraft/world/attribute/BedRule;getFailureReason()Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;
      intermediary method_75641 Lnet/minecraft/class_12195;method_75641()Lnet/minecraft/class_1657$class_1658;
      official a Lcdx;a()Ldcm$a;
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • canSleep

      public BedRule.Condition canSleep()
      Returns the value of the canSleep record component.
      Returns:
      the value of the canSleep record component
    • canSetSpawn

      public BedRule.Condition canSetSpawn()
      Returns the value of the canSetSpawn record component.
      Returns:
      the value of the canSetSpawn record component
    • explodes

      public boolean explodes()
      Returns the value of the explodes record component.
      Returns:
      the value of the explodes record component
    • errorMessage

      public Optional<Text> errorMessage()
      Returns the value of the errorMessage record component.
      Returns:
      the value of the errorMessage record component