#Sign Gui

1 messages · Page 1 of 1 (latest)

warm belfry
#

How can I create a sign gui to get player's input

short berry
#

there are many resources out there, you can use packets to send a fake sign edit packet then listen for the change

warm belfry
#

but im getting an error

rotund galleon
# warm belfry

Well, looks like there is an issue with you signNBT instance, check that it's correctly instanciated

rotund galleon
#

Check for null when reading the sign

#

And look if it makes sense that it is null

#

If not, something's wrong with the sign data being read

warm belfry
rotund galleon
#

I mean, ofc since it has a NPE

warm belfry
#
    private static final SignMenuFactory factory = getSignMenuFactory();

    public static void SendSignGUI(Player target) {
        SignMenuFactory.Menu menu = factory.newMenu(Arrays.asList("", "^^^^^^^^^", "Enter the amount", "to deposit"))
                .reopenIfFail(true)
                .response((player, strings) -> {
                    if (!strings[0].equalsIgnoreCase("sign")) {
                        player.sendMessage("Wrong!");
                        return false;
                    }
                    return true;
                });

        menu.open(target);
    }
}```
rotund galleon
#

Most likely a problem with the lib

#

In that read section