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 SummaryFieldsModifier and TypeFieldDescriptionprivate final intThe field for theentityIdrecord component.private final intThe field for thesourceCauseIdrecord component.private final intThe field for thesourceDirectIdrecord component.The field for thesourcePositionrecord component.private final intThe field for thesourceTypeIdrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionClientboundDamageEventPacket(int entityId, int sourceTypeId, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition) Creates an instance of aClientboundDamageEventPacketrecord class.ClientboundDamageEventPacket(FriendlyByteBuf p_270722_) ClientboundDamageEventPacket(Entity p_270474_, DamageSource p_270781_) 
- 
Method SummaryModifier and TypeMethodDescriptionintentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener p_270510_) final inthashCode()Returns a hash code value for this object.private static intreadOptionalEntityId(FriendlyByteBuf p_270462_) intReturns the value of thesourceCauseIdrecord component.intReturns the value of thesourceDirectIdrecord component.Returns the value of thesourcePositionrecord component.intReturns the value of thesourceTypeIdrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf p_270971_) private static voidwriteOptionalEntityId(FriendlyByteBuf p_270812_, int p_270852_) Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.PacketisSkippable, nextProtocol
- 
Field Details- 
entityIdprivate final int entityIdThe field for theentityIdrecord component.
- 
sourceTypeIdprivate final int sourceTypeIdThe field for thesourceTypeIdrecord component.
- 
sourceCauseIdprivate final int sourceCauseIdThe field for thesourceCauseIdrecord component.
- 
sourceDirectIdprivate final int sourceDirectIdThe field for thesourceDirectIdrecord component.
- 
sourcePositionThe field for thesourcePositionrecord component.
 
- 
- 
Constructor Details- 
ClientboundDamageEventPacket
- 
ClientboundDamageEventPacket
- 
ClientboundDamageEventPacketpublic ClientboundDamageEventPacket(int entityId, int sourceTypeId, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition) Creates an instance of aClientboundDamageEventPacketrecord class.- Parameters:
- entityId- the value for the- entityIdrecord component
- sourceTypeId- the value for the- sourceTypeIdrecord component
- sourceCauseId- the value for the- sourceCauseIdrecord component
- sourceDirectId- the value for the- sourceDirectIdrecord component
- sourcePosition- the value for the- sourcePositionrecord component
 
 
- 
- 
Method Details- 
writeOptionalEntityId
- 
readOptionalEntityId
- 
write- Specified by:
- writein interface- Packet<ClientGamePacketListener>
 
- 
handle- Specified by:
- handlein interface- Packet<ClientGamePacketListener>
 
- 
getSource
- 
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 '=='.
- 
entityIdpublic int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the entityIdrecord component
 
- 
sourceTypeIdpublic int sourceTypeId()Returns the value of thesourceTypeIdrecord component.- Returns:
- the value of the sourceTypeIdrecord component
 
- 
sourceCauseIdpublic int sourceCauseId()Returns the value of thesourceCauseIdrecord component.- Returns:
- the value of the sourceCauseIdrecord component
 
- 
sourceDirectIdpublic int sourceDirectId()Returns the value of thesourceDirectIdrecord component.- Returns:
- the value of the sourceDirectIdrecord component
 
- 
sourcePositionReturns the value of thesourcePositionrecord component.- Returns:
- the value of the sourcePositionrecord component
 
 
-