[Demonstration 1]

[Buggy Method]
@SubscribeEvent
public void onLivingAttack(LivingAttackEvent event) {
    // Mod authors: If your mod adds custom spiders, and you want them to work with
    // this mod, make them subclass EntitySpider (like vanilla cave spiders do).
    if (!(event.getSource().getEntity() instanceof EntitySpider))
        return;
    Entity target = event.getEntity();
    World world = target.worldObj;
    BlockPos pos = new BlockPos(target.posX, target.posY, target.posZ);
    IBlockState state = world.getBlockState(pos);
    Block oldBlock = state.getBlock();
    if (!oldBlock.isReplaceable(world, pos))
        return;
    if (!allowReplacement && !oldBlock.isAir(state, world, pos))
        return;
    if (webChance < world.rand.nextDouble())
        return;
    world.setBlockState(pos, Blocks.WEB.getDefaultState());
    target.setInWeb();
    if (target instanceof EntityPlayerMP) {
        // If we don't tell the client about the web ourself, it won't get told until after the
        // attack resolves. This will result in the client thinking the player got knocked back
        // further than they really did, which in turn will result in a "player moved wrongly"
        // message on the server.
        netWrapper.sendTo(new PlayerInWebMessage(pos), (EntityPlayerMP) target);
    }
}

[Buggy Hunk]
if(webChance < world.rand.nextDouble())

[Patch]
if(webChance <= world.rand.nextDouble())

[Demonstration 2]

[Buggy Method]
@Override
public void resolve() {
    if (target != null) {
        target.remove();
        owner.draw();
    }
}

[Buggy Hunk]
target.remove();

[Patch]
to.destroy(target);

[Demonstration 3]

[Buggy Method]
public void mouseDragged() {
    if (isDragged == false) {
        for (Character character : characters) {
            if (character.drag(pmouseX, pmouseY)) {
                this.isDragged = true;
                draggedCh = character;
                break;
            }
        }
    } else {
        draggedCh.drag(pmouseX, pmouseY);
    }
}

[Buggy Hunk]
if(character.drag(pmouseX, pmouseY)) {

[Patch]
if(character.inRegion(pmouseX, pmouseY)) {