Class SpawnEntity
java.lang.Object
net.minecraftforge.network.packets.SpawnEntity
Used to spawn a custom entity without the same restrictions as
 
ClientboundAddEntityPacket
 
 To customize how your entity is created clientside (instead of using the default factory provided to the
 EntityType)
 see EntityType.Builder.setCustomClientFactory(java.util.function.BiFunction<net.minecraftforge.network.packets.SpawnEntity, net.minecraft.world.level.Level, T>).
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final FriendlyByteBufprivate final Entityprivate final intprivate final byteprivate final byteprivate final doubleprivate final doubleprivate final doubleprivate final intprivate final UUIDprivate final intprivate final intprivate final intprivate final byte
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateSpawnEntity(int typeId, int entityId, UUID uuid, double posX, double posY, double posZ, byte pitch, byte yaw, byte headYaw, int velX, int velY, int velZ, FriendlyByteBuf buf) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic SpawnEntitydecode(FriendlyByteBuf buf) static voidencode(SpawnEntity msg, FriendlyByteBuf buf) intbytebytegetPitch()doublegetPosX()doublegetPosY()doublegetPosZ()intgetUuid()intgetVelX()intgetVelY()intgetVelZ()bytegetYaw()static voidhandle(SpawnEntity msg, CustomPayloadEvent.Context ctx) private static FriendlyByteBuf
- 
Field Details- 
entity
- 
typeIdprivate final int typeId
- 
entityIdprivate final int entityId
- 
uuid
- 
posXprivate final double posX
- 
posYprivate final double posY
- 
posZprivate final double posZ
- 
pitchprivate final byte pitch
- 
yawprivate final byte yaw
- 
headYawprivate final byte headYaw
- 
velXprivate final int velX
- 
velYprivate final int velY
- 
velZprivate final int velZ
- 
buf
 
- 
- 
Constructor Details- 
SpawnEntity
- 
SpawnEntityprivate SpawnEntity(int typeId, int entityId, UUID uuid, double posX, double posY, double posZ, byte pitch, byte yaw, byte headYaw, int velX, int velY, int velZ, FriendlyByteBuf buf) 
 
- 
- 
Method Details- 
encode
- 
decode
- 
readSpawnDataPacket
- 
handle
- 
getEntity
- 
getTypeIdpublic int getTypeId()
- 
getEntityIdpublic int getEntityId()
- 
getUuid
- 
getPosXpublic double getPosX()
- 
getPosYpublic double getPosY()
- 
getPosZpublic double getPosZ()
- 
getPitchpublic byte getPitch()
- 
getYawpublic byte getYaw()
- 
getHeadYawpublic byte getHeadYaw()
- 
getVelXpublic int getVelX()
- 
getVelYpublic int getVelY()
- 
getVelZpublic int getVelZ()
- 
getAdditionalData
 
-