Class FMLPlayMessages.SpawnEntity
java.lang.Object
net.minecraftforge.fmllegacy.network.FMLPlayMessages.SpawnEntity
- Enclosing class:
- FMLPlayMessages
Used to spawn a custom entity without the same restrictions as
ClientboundAddEntityPacket or ClientboundAddMobPacket
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.fmllegacy.network.FMLPlayMessages.SpawnEntity, net.minecraft.world.level.Level, T>).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FriendlyByteBufprivate Entityprivate intprivate byteprivate byteprivate doubleprivate doubleprivate doubleprivate intprivate UUIDprivate intprivate intprivate intprivate byte -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSpawnEntity(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)(package private)SpawnEntity(Entity e) -
Method Summary
Modifier and TypeMethodDescriptionstatic FMLPlayMessages.SpawnEntitydecode(FriendlyByteBuf buf)static voidencode(FMLPlayMessages.SpawnEntity msg, FriendlyByteBuf buf)intbytebytegetPitch()doublegetPosX()doublegetPosY()doublegetPosZ()intgetUuid()intgetVelX()intgetVelY()intgetVelZ()bytegetYaw()static void
-
Field Details
-
entity
-
typeId
private final int typeId -
entityId
private final int entityId -
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
-
-
Constructor Details
-
SpawnEntity
SpawnEntity(Entity e) -
SpawnEntity
private 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
-
handle
-
getEntity
-
getTypeId
public int getTypeId() -
getEntityId
public int getEntityId() -
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
-