类 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>)
.
-
字段概要
字段修饰符和类型字段说明private final FriendlyByteBuf
private final Entity
private final int
private final byte
private final byte
private final double
private final double
private final double
static final StreamCodec
<RegistryFriendlyByteBuf, SpawnEntity> private final int
private final UUID
private final int
private final int
private final int
private final byte
-
构造器概要
构造器限定符构造器说明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) -
方法概要
修饰符和类型方法说明static SpawnEntity
decode
(FriendlyByteBuf buf) static void
encode
(SpawnEntity msg, FriendlyByteBuf buf) int
byte
byte
getPitch()
double
getPosX()
double
getPosY()
double
getPosZ()
int
getUuid()
int
getVelX()
int
getVelY()
int
getVelZ()
byte
getYaw()
static void
handle
(SpawnEntity msg, CustomPayloadEvent.Context ctx) private static FriendlyByteBuf
-
字段详细资料
-
STREAM_CODEC
-
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
-
-
构造器详细资料
-
SpawnEntity
-
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)
-
-
方法详细资料
-
encode
-
decode
-
readSpawnDataPacket
-
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
-