Record Class IsKeybindDown
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.properties.conditional.IsKeybindDown
- All Implemented Interfaces:
ConditionalItemModelProperty, ItemModelPropertyTest
public record IsKeybindDown(KeyMapping keybind)
extends Record
implements ConditionalItemModelProperty
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final KeyMappingThe field for thekeybindrecord component.private static final com.mojang.serialization.Codec<KeyMapping> static final com.mojang.serialization.MapCodec<IsKeybindDown> -
Constructor Summary
ConstructorsConstructorDescriptionIsKeybindDown(KeyMapping keybind) Creates an instance of aIsKeybindDownrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanget(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext) final inthashCode()Returns a hash code value for this object.keybind()Returns the value of thekeybindrecord component.final StringtoString()Returns a string representation of this record class.com.mojang.serialization.MapCodec<IsKeybindDown> type()
-
Field Details
-
keybind
The field for thekeybindrecord component. -
KEYBIND_CODEC
-
MAP_CODEC
-
-
Constructor Details
-
IsKeybindDown
Creates an instance of aIsKeybindDownrecord class.- Parameters:
keybind- the value for thekeybindrecord component
-
-
Method Details
-
get
public boolean get(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext) - Specified by:
getin interfaceItemModelPropertyTest
-
type
- Specified by:
typein interfaceConditionalItemModelProperty
-
toString
-
hashCode
-
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). -
keybind
Returns the value of thekeybindrecord component.- Returns:
- the value of the
keybindrecord component
-