@Override
    public void openPrompt(@Nonnull Player player, @Nonnull List<String> lines, @Nonnull ResponseHandler responseHandler) {
        Location location = player.getLocation().clone();
        location.setY(255);
        Players.sendBlockChange(player, location, Material.WALL_SIGN);

        BlockPosition position = new BlockPosition(location.toVector());
        PacketContainer writeToSign = new PacketContainer(PacketType.Play.Server.TILE_ENTITY_DATA);
        writeToSign.getBlockPositionModifier().write(0, position);
        writeToSign.getIntegers().write(0, 9);
        NbtCompound compound = NbtFactory.ofCompound("");

        for (int i = 0; i < 4; i++) {
            compound.put("Text" + (i + 1), "{\"text\":\"" + (lines.size() > i ? lines.get(i) : "") + "\"}");
        }

        compound.put("id", "minecraft:sign");
        compound.put("x", position.getX());
        compound.put("y", position.getY());
        compound.put("z", position.getZ());

        writeToSign.getNbtModifier().write(0, compound);
        Protocol.sendPacket(player, writeToSign);

        PacketContainer openSign = new PacketContainer(PacketType.Play.Server.OPEN_SIGN_EDITOR);
        openSign.getBlockPositionModifier().write(0, position);
        Protocol.sendPacket(player, openSign);

        // we need to ensure that the callback is only called once.
        final AtomicBoolean active = new AtomicBoolean(true);

        Protocol.subscribe(PacketType.Play.Client.UPDATE_SIGN)
                .filter(e -> e.getPlayer().getUniqueId().equals(player.getUniqueId()))
                .biHandler((sub, event) -> {
                    if (!active.getAndSet(false)) {
                        return;
                    }

                    PacketContainer container = event.getPacket();

                    List<String> input = MinecraftVersion.getRuntimeVersion().isAfterOrEq(MinecraftVersions.v1_9)
                            ? new ArrayList<>(Arrays.asList(container.getStringArrays().read(0)))
                            : getInputForLegacyVersions(container);
                    Response response = responseHandler.handleResponse(input);

                    if (response == Response.TRY_AGAIN) {
                        // didn't pass, re-send the sign and request another input
                        Schedulers.sync().runLater(() -> {
                            if (player.isOnline()) {
                                openPrompt(player, lines, responseHandler);
                            }
                        }, 1L);
                    }

                    // cleanup this instance
                    sub.close();
                    Players.sendBlockChange(player, location, Material.AIR);
                });
    }
Implementation of {@link SignPromptFactory} using ProtocolLib.
helper/src/main/java/me/lucko/helper/signprompt/PacketSignPromptFactory.java