Search in sources :

Example 1 with AetherPoisonMovement

use of com.aether.entities.util.AetherPoisonMovement 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;
    }
}
Also used : PacketByteBuf(net.minecraft.network.PacketByteBuf) CustomPayloadC2SPacket(net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) AetherPoisonMovement(com.aether.entities.util.AetherPoisonMovement)

Aggregations

AetherPoisonMovement (com.aether.entities.util.AetherPoisonMovement)1 PacketByteBuf (net.minecraft.network.PacketByteBuf)1 CustomPayloadC2SPacket (net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket)1 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)1