Package net.minecraft.component.type
Record Class ToolComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.ToolComponent
- Record Components:
rules-defaultMiningSpeed-damagePerBlock-
public record ToolComponent(List<ToolComponent.Rule> rules, float defaultMiningSpeed, int damagePerBlock)
extends Record
- Mappings:
Namespace Name named net/minecraft/component/type/ToolComponentintermediary net/minecraft/class_9424official cxxnamed rulesintermediary comp_2498official cnamed defaultMiningSpeedintermediary comp_2499official dnamed damagePerBlockintermediary comp_2500official e
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ToolComponent> private final intThe field for thedamagePerBlockrecord component.private final floatThe field for thedefaultMiningSpeedrecord component.static final PacketCodec<RegistryByteBuf, ToolComponent> private final List<ToolComponent.Rule> The field for therulesrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedamagePerBlockrecord component.floatReturns the value of thedefaultMiningSpeedrecord component.final booleanIndicates whether some other object is "equal to" this one.floatgetSpeed(BlockState state) final inthashCode()Returns a hash code value for this object.booleanisCorrectForDrops(BlockState state) rules()Returns the value of therulesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
rules
The field for therulesrecord component. -
defaultMiningSpeed
private final float defaultMiningSpeedThe field for thedefaultMiningSpeedrecord component. -
damagePerBlock
private final int damagePerBlockThe field for thedamagePerBlockrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/ToolComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_50009Lnet/minecraft/class_9424;field_50009:Lcom/mojang/serialization/Codec;official aLcxx;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/ToolComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_50010Lnet/minecraft/class_9424;field_50010:Lnet/minecraft/class_9139;official bLcxx;b:Lyx;
-
-
Constructor Details
-
ToolComponent
-
-
Method Details
-
getSpeed
- Mappings:
Namespace Name Mixin selector named getSpeedLnet/minecraft/component/type/ToolComponent;getSpeed(Lnet/minecraft/block/BlockState;)Fintermediary method_58425Lnet/minecraft/class_9424;method_58425(Lnet/minecraft/class_2680;)Fofficial aLcxx;a(Ldtc;)F
-
isCorrectForDrops
- Mappings:
Namespace Name Mixin selector named isCorrectForDropsLnet/minecraft/component/type/ToolComponent;isCorrectForDrops(Lnet/minecraft/block/BlockState;)Zintermediary method_58426Lnet/minecraft/class_9424;method_58426(Lnet/minecraft/class_2680;)Zofficial bLcxx;b(Ldtc;)Z
-
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 '=='. -
rules
Returns the value of therulesrecord component.- Returns:
- the value of the
rulesrecord component
-
defaultMiningSpeed
public float defaultMiningSpeed()Returns the value of thedefaultMiningSpeedrecord component.- Returns:
- the value of the
defaultMiningSpeedrecord component
-
damagePerBlock
public int damagePerBlock()Returns the value of thedamagePerBlockrecord component.- Returns:
- the value of the
damagePerBlockrecord component
-