HomeJavaModsSignGUI
SignGUI
[​IMG] [​IMG] [​IMG]

This resource is out of date and only works on Minecraft 1.8 servers

Sign GUI allows developers to easily open and retrieve text from a Sign GUI window. Event handling is done in exactly the same way every other spigot event is handled making it intuitive to use for any spigot developer!

This plugin does nothing on it's own. It is a library intended to be used by developers to incorporate sign gui editors into their plugins.

Only tested on Spigot v1.8
Requires:
ProtocolLib

[​IMG]
[​IMG]
Code (Text):
String[] text = new String[]{ChatColor.BOLD + "Sign GUI Lib", player.getName(), "Enter some text:", ""};
SignGUI.openSignEditor(player, text);
[​IMG]

[​IMG]
When the player clicks 'Done' in the sign editor gui, a SignGUIUpdateEvent is fired. You can listen for this event just like you would listen for any other spigot event.

In your onEnable() method, register an event listener for the sign gui.
Code (Text):
public void onEnable()
{
    getServer().getPluginManager().registerEvents(new OnSignGUIUpdateEvent(), this);
}
In this example, when the event is fired the code simply prints back to the player the text that was inside the sign.
Code (Text):
public class OnSignGUIUpdateEvent implements Listener
{
    @EventHandler
    public void signUpdate(SignGUIUpdateEvent event)
    {
        Player player = event.getPlayer();
 
        for(String str : event.getSignText())
        {
            player.sendMessage(str);
        }
    }
}
Result:
[​IMG]


Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

SignGUI is a free Minecraft Java mod. Compatible with Minecraft 1.8. Downloaded 967 times (via Spigot). Download it and open it directly in the game.

Explore more