1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Experimental SGUI-API 0.1.0-Alpha

Minecraft Nukkit Plugin GUI API

  1. hhm
    Compatible API Versions:
    1.0.0
    Sourcecode:
    https://github.com/hhm666/SGUI-API
    Contributors:
    hhm
    SGUI-API

    Current Versoin:0.1.0-Alpha


    SGUI-API depends on KotlinLib

    Notice:This plugin is for developers to use. Separate installation does not work. It requires other plugins to work with.

    Example usage:

    Code (Java):

    class SLogin : PluginBase(),Listener {
        private lateinit var loginGUI: LambdaCustomGUI

        override fun onLoad() {
            loginGUI = LambdaCustomGUI("SLogin_login", "Validation")
            loginGUI.addText("t1", "§l§6Welcome,Please enter nice below!")
            loginGUI.addInput("pw", "Verification Code")
            loginGUI.submittedClickedListener = BiConsumer { data, player ->
                if (player !is NukkitPlayer) return@BiConsumer
                if(data["pw"].toString()=="nice") {
                    player.sendMessage("Verify success!")
                }else{
                    player.kick("§cValidation failed")
                }
            }
            loginGUI.closedClickedListener = Consumer {
                player.kick("§cValidation failed")
            }
            this.server.pluginManager.registerEvents(GUIListener(), this)
            this.server.pluginManager.registerEvents(this, this)
        }
     
        @EventHandler(priority = EventPriority.LOWEST)
        fun onJoin(event: PlayerJoinEvent) {
            if (event.player !is NukkitPlayer) return
            player.showGUI(loginGUI)
        }
    }
     
    Please refer to the JavaDoc for specific usage.