use of net.minecraft.network.PacketByteBuf in project Hypnotic-Client by Hypnotic-Development.
the class Criticals method getEntity.
public static Entity getEntity(PlayerInteractEntityC2SPacket packet) {
PacketByteBuf packetBuf = new PacketByteBuf(Unpooled.buffer());
packet.write(packetBuf);
return mc.world.getEntityById(packetBuf.readVarInt());
}
use of net.minecraft.network.PacketByteBuf in project Paradise-Lost by devs-immortal.
the class AetherNonLivingEntity method createSpawnPacket.
@Override
public final Packet<?> createSpawnPacket() {
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
Identifier id = this.createSpawnPacket(buf);
for (ServerPlayerEntity playerEntity : ((ServerWorld) this.world).getPlayers()) {
ServerSidePacketRegistry.INSTANCE.sendToPlayer(playerEntity, id, buf);
}
return new EntitySpawnS2CPacket(this);
}
use of net.minecraft.network.PacketByteBuf in project Paradise-Lost by devs-immortal.
the class PoisonDartEntity method onHit.
@Override
protected void onHit(LivingEntity entityIn) {
super.onHit(entityIn);
if (entityIn instanceof ServerPlayerEntity) {
// AetherAPI.get((PlayerEntity) entityIn).inflictPoison(500);
PacketByteBuf byteBuf = new PacketByteBuf(Unpooled.buffer());
byteBuf.writeInt(500);
((ServerPlayerEntity) entityIn).networkHandler.sendPacket(new CustomPayloadC2SPacket(Aether.locate("poison"), byteBuf));
} else {
this.victim = entityIn;
this.poison = new AetherPoisonMovement(this.victim);
this.poison.inflictPoison(500);
this.removed = false;
}
}
use of net.minecraft.network.PacketByteBuf in project LittleMaidModelLoader-Fabric by SistrScarlet.
the class LMSoundPacket method sendS2CPacket.
public static void sendS2CPacket(Entity entity, String soundName) {
PacketByteBuf passedData = createS2CPacket(entity, soundName);
PlayerLookup.tracking(entity).forEach(watchingPlayer -> ServerPlayNetworking.send(watchingPlayer, ID, passedData));
}
use of net.minecraft.network.PacketByteBuf in project LittleMaidModelLoader-Fabric by SistrScarlet.
the class SyncMultiModelPacket method sendS2CPacket.
public static void sendS2CPacket(Entity entity, IHasMultiModel hasMultiModel) {
PacketByteBuf passedData = createS2CPacket(entity, hasMultiModel);
PlayerLookup.tracking(entity).forEach(watchingPlayer -> ServerPlayNetworking.send(watchingPlayer, ID, passedData));
}
Aggregations