Record Class ClientboundCooldownPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundCooldownPacket
- All Implemented Interfaces:
- Packet<ClientGamePacketListener>
public record ClientboundCooldownPacket(Item item, int duration)
extends Record
implements Packet<ClientGamePacketListener>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final intThe field for thedurationrecord component.private final ItemThe field for theitemrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundCooldownPacket> 
- 
Constructor SummaryConstructorsConstructorDescriptionClientboundCooldownPacket(Item item, int duration) Creates an instance of aClientboundCooldownPacketrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionintduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener p_132007_) final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.PacketisSkippable, isTerminal
- 
Field Details- 
itemThe field for theitemrecord component.
- 
durationprivate final int durationThe field for thedurationrecord component.
- 
STREAM_CODEC
 
- 
- 
Constructor Details- 
ClientboundCooldownPacketCreates an instance of aClientboundCooldownPacketrecord class.- Parameters:
- item- the value for the- itemrecord component
- duration- the value for the- durationrecord component
 
 
- 
- 
Method Details- 
type- Specified by:
- typein interface- Packet<ClientGamePacketListener>
 
- 
handle- Specified by:
- handlein interface- Packet<ClientGamePacketListener>
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
itemReturns the value of theitemrecord component.- Returns:
- the value of the itemrecord component
 
- 
durationpublic int duration()Returns the value of thedurationrecord component.- Returns:
- the value of the durationrecord component
 
 
-