Record Class ClientboundDamageEventPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundDamageEventPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundDamageEventPacket(int entityId, int sourceTypeId, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for theentityId
record component.private final int
The field for thesourceCauseId
record component.private final int
The field for thesourceDirectId
record component.The field for thesourcePosition
record component.private final int
The field for thesourceTypeId
record component. -
Constructor Summary
ConstructorDescriptionClientboundDamageEventPacket
(int entityId, int sourceTypeId, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition) Creates an instance of aClientboundDamageEventPacket
record class.ClientboundDamageEventPacket
(FriendlyByteBuf p_270722_) ClientboundDamageEventPacket
(Entity p_270474_, DamageSource p_270781_) -
Method Summary
Modifier and TypeMethodDescriptionint
entityId()
Returns the value of theentityId
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_270510_) final int
hashCode()
Returns a hash code value for this object.private static int
readOptionalEntityId
(FriendlyByteBuf p_270462_) int
Returns the value of thesourceCauseId
record component.int
Returns the value of thesourceDirectId
record component.Returns the value of thesourcePosition
record component.int
Returns the value of thesourceTypeId
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_270971_) private static void
writeOptionalEntityId
(FriendlyByteBuf p_270812_, int p_270852_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, nextProtocol
-
Field Details
-
entityId
private final int entityIdThe field for theentityId
record component. -
sourceTypeId
private final int sourceTypeIdThe field for thesourceTypeId
record component. -
sourceCauseId
private final int sourceCauseIdThe field for thesourceCauseId
record component. -
sourceDirectId
private final int sourceDirectIdThe field for thesourceDirectId
record component. -
sourcePosition
The field for thesourcePosition
record component.
-
-
Constructor Details
-
ClientboundDamageEventPacket
-
ClientboundDamageEventPacket
-
ClientboundDamageEventPacket
public ClientboundDamageEventPacket(int entityId, int sourceTypeId, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition) Creates an instance of aClientboundDamageEventPacket
record class.- Parameters:
entityId
- the value for theentityId
record componentsourceTypeId
- the value for thesourceTypeId
record componentsourceCauseId
- the value for thesourceCauseId
record componentsourceDirectId
- the value for thesourceDirectId
record componentsourcePosition
- the value for thesourcePosition
record component
-
-
Method Details
-
writeOptionalEntityId
-
readOptionalEntityId
-
write
- Specified by:
write
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
getSource
-
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 '=='. -
entityId
public int entityId()Returns the value of theentityId
record component.- Returns:
- the value of the
entityId
record component
-
sourceTypeId
public int sourceTypeId()Returns the value of thesourceTypeId
record component.- Returns:
- the value of the
sourceTypeId
record component
-
sourceCauseId
public int sourceCauseId()Returns the value of thesourceCauseId
record component.- Returns:
- the value of the
sourceCauseId
record component
-
sourceDirectId
public int sourceDirectId()Returns the value of thesourceDirectId
record component.- Returns:
- the value of the
sourceDirectId
record component
-
sourcePosition
Returns the value of thesourcePosition
record component.- Returns:
- the value of the
sourcePosition
record component
-