Package net.minecraft.world.attribute
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/BedRuleintermediary net/minecraft/class_12195official cdvnamed canSleepintermediary comp_5136official dnamed canSetSpawnintermediary comp_5137official enamed explodesintermediary comp_5138official fnamed errorMessageintermediary comp_5139official g
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BedRule.ConditionThe field for thecanSetSpawnrecord component.private final BedRule.ConditionThe field for thecanSleeprecord component.static final com.mojang.serialization.Codec<BedRule> The field for theerrorMessagerecord component.private final booleanThe field for theexplodesrecord component.static final BedRulestatic final BedRule -
Constructor Summary
ConstructorsConstructorDescriptionBedRule(BedRule.Condition canSleep, BedRule.Condition canSetSpawn, boolean explodes, Optional<Text> errorMessage) Creates an instance of aBedRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecanSetSpawnrecord component.booleancanSetSpawn(World world) canSleep()Returns the value of thecanSleeprecord component.booleanfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.booleanexplodes()Returns the value of theexplodesrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
canSleep
The field for thecanSleeprecord component. -
canSetSpawn
The field for thecanSetSpawnrecord component. -
explodes
private final boolean explodesThe field for theexplodesrecord component. -
errorMessage
The field for theerrorMessagerecord component. -
OVERWORLD
- Mappings:
Namespace Name Mixin selector named OVERWORLDLnet/minecraft/world/attribute/BedRule;OVERWORLD:Lnet/minecraft/world/attribute/BedRule;intermediary field_63703Lnet/minecraft/class_12195;field_63703:Lnet/minecraft/class_12195;official aLcdv;a:Lcdv;
-
OTHER_DIMENSION
- Mappings:
Namespace Name Mixin selector named OTHER_DIMENSIONLnet/minecraft/world/attribute/BedRule;OTHER_DIMENSION:Lnet/minecraft/world/attribute/BedRule;intermediary field_63704Lnet/minecraft/class_12195;field_63704:Lnet/minecraft/class_12195;official bLcdv;b:Lcdv;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/world/attribute/BedRule;CODEC:Lcom/mojang/serialization/Codec;intermediary field_63705Lnet/minecraft/class_12195;field_63705:Lcom/mojang/serialization/Codec;official cLcdv;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 aBedRulerecord class.- Parameters:
canSleep- the value for thecanSleeprecord componentcanSetSpawn- the value for thecanSetSpawnrecord componentexplodes- the value for theexplodesrecord componenterrorMessage- the value for theerrorMessagerecord component
-
-
Method Details
-
canSleep
- Mappings:
Namespace Name Mixin selector named canSleepLnet/minecraft/world/attribute/BedRule;canSleep(Lnet/minecraft/world/World;)Zintermediary method_75643Lnet/minecraft/class_12195;method_75643(Lnet/minecraft/class_1937;)Zofficial aLcdv;a(Ldup;)Z
-
canSetSpawn
- Mappings:
Namespace Name Mixin selector named canSetSpawnLnet/minecraft/world/attribute/BedRule;canSetSpawn(Lnet/minecraft/world/World;)Zintermediary method_75644Lnet/minecraft/class_12195;method_75644(Lnet/minecraft/class_1937;)Zofficial bLcdv;b(Ldup;)Z
-
getFailureReason
- Mappings:
Namespace Name Mixin selector named getFailureReasonLnet/minecraft/world/attribute/BedRule;getFailureReason()Lnet/minecraft/entity/player/PlayerEntity$SleepFailureReason;intermediary method_75641Lnet/minecraft/class_12195;method_75641()Lnet/minecraft/class_1657$class_1658;official aLcdv;a()Ldcc$a;
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
canSleep
Returns the value of thecanSleeprecord component.- Returns:
- the value of the
canSleeprecord component
-
canSetSpawn
Returns the value of thecanSetSpawnrecord component.- Returns:
- the value of the
canSetSpawnrecord component
-
explodes
public boolean explodes()Returns the value of theexplodesrecord component.- Returns:
- the value of the
explodesrecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-