Package net.minecraftforge.fml.network
Class FMLPlayMessages.SpawnEntity
- java.lang.Object
-
- net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity
-
- Enclosing class:
- FMLPlayMessages
public static class FMLPlayMessages.SpawnEntity extends java.lang.ObjectUsed to spawn a custom entity without the same restrictions asSSpawnObjectPacketorSSpawnMobPacketTo customize how your entity is created clientside (instead of using the default factory provided to theEntityType) seeEntityType.Builder.setCustomClientFactory(java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, net.minecraft.world.World, T>).
-
-
Field Summary
Fields Modifier and Type Field Description private PacketBufferbufprivate Entityentityprivate intentityIdprivate byteheadYawprivate bytepitchprivate doubleposXprivate doubleposYprivate doubleposZprivate inttypeIdprivate java.util.UUIDuuidprivate intvelXprivate intvelYprivate intvelZprivate byteyaw
-
Constructor Summary
Constructors Modifier Constructor Description privateSpawnEntity(int typeId, int entityId, java.util.UUID uuid, double posX, double posY, double posZ, byte pitch, byte yaw, byte headYaw, int velX, int velY, int velZ, PacketBuffer buf)(package private)SpawnEntity(Entity e)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FMLPlayMessages.SpawnEntitydecode(PacketBuffer buf)static voidencode(FMLPlayMessages.SpawnEntity msg, PacketBuffer buf)PacketBuffergetAdditionalData()EntitygetEntity()intgetEntityId()bytegetHeadYaw()bytegetPitch()doublegetPosX()doublegetPosY()doublegetPosZ()intgetTypeId()java.util.UUIDgetUuid()intgetVelX()intgetVelY()intgetVelZ()bytegetYaw()static voidhandle(FMLPlayMessages.SpawnEntity msg, java.util.function.Supplier<NetworkEvent.Context> ctx)
-
-
-
Field Detail
-
entity
private final Entity entity
-
typeId
private final int typeId
-
entityId
private final int entityId
-
uuid
private final java.util.UUID uuid
-
posX
private final double posX
-
posY
private final double posY
-
posZ
private final double posZ
-
pitch
private final byte pitch
-
yaw
private final byte yaw
-
headYaw
private final byte headYaw
-
velX
private final int velX
-
velY
private final int velY
-
velZ
private final int velZ
-
buf
private final PacketBuffer buf
-
-
Constructor Detail
-
SpawnEntity
SpawnEntity(Entity e)
-
SpawnEntity
private SpawnEntity(int typeId, int entityId, java.util.UUID uuid, double posX, double posY, double posZ, byte pitch, byte yaw, byte headYaw, int velX, int velY, int velZ, PacketBuffer buf)
-
-
Method Detail
-
encode
public static void encode(FMLPlayMessages.SpawnEntity msg, PacketBuffer buf)
-
decode
public static FMLPlayMessages.SpawnEntity decode(PacketBuffer buf)
-
handle
public static void handle(FMLPlayMessages.SpawnEntity msg, java.util.function.Supplier<NetworkEvent.Context> ctx)
-
getEntity
public Entity getEntity()
-
getTypeId
public int getTypeId()
-
getEntityId
public int getEntityId()
-
getUuid
public java.util.UUID getUuid()
-
getPosX
public double getPosX()
-
getPosY
public double getPosY()
-
getPosZ
public double getPosZ()
-
getPitch
public byte getPitch()
-
getYaw
public byte getYaw()
-
getHeadYaw
public byte getHeadYaw()
-
getVelX
public int getVelX()
-
getVelY
public int getVelY()
-
getVelZ
public int getVelZ()
-
getAdditionalData
public PacketBuffer getAdditionalData()
-
-