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.Object
Used to spawn a custom entity without the same restrictions asSSpawnObjectPacket
orSSpawnMobPacket
To 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 PacketBuffer
buf
private Entity
entity
private int
entityId
private byte
headYaw
private byte
pitch
private double
posX
private double
posY
private double
posZ
private int
typeId
private java.util.UUID
uuid
private int
velX
private int
velY
private int
velZ
private byte
yaw
-
Constructor Summary
Constructors Modifier Constructor Description 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)
(package private)
SpawnEntity(Entity e)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FMLPlayMessages.SpawnEntity
decode(PacketBuffer buf)
static void
encode(FMLPlayMessages.SpawnEntity msg, PacketBuffer buf)
PacketBuffer
getAdditionalData()
Entity
getEntity()
int
getEntityId()
byte
getHeadYaw()
byte
getPitch()
double
getPosX()
double
getPosY()
double
getPosZ()
int
getTypeId()
java.util.UUID
getUuid()
int
getVelX()
int
getVelY()
int
getVelZ()
byte
getYaw()
static void
handle(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()
-
-