TextGUI
You want the player to input a single line of text, but chat is either too busy or not an interesting medium. How about through an Anvil interface? Creating one is simple - you may either instantiate a TextGUI object or extend the class, but with the added step of calling the #build
method.
This inventory type uses the AnvilGUI library, which in turn uses NMS code. You may need to update the MilkGUI version for your plugin after each Minecraft update if using a TextGUI.
Option 1: Object
Quick and easy, this method is ideal for infrequent use of your GUI:
If your resource supports versions of Minecraft both before and after 1.13, you'll need to be careful with Materials. Passing as a String instead ("APPLE") may give you better results with some items, but we recommend using a library like XMaterial.
Option 2: Extended Class
This method is preferred if you intend to reuse your GUI frequently and/or show it to multiple players at once. For example:
If your resource supports versions of Minecraft both before and after 1.13, you'll need to be careful with Materials. Passing as a String instead ("APPLE") may give you better results with some items, but we recommend using a library like XMaterial.
Last updated