-
Notifications
You must be signed in to change notification settings - Fork 19
Anvil
Hakan Kargın edited this page Jun 7, 2022
·
3 revisions
With this feature you can easily get inputs from players via anvil gui.
public void open(Player player) {
HAnvil anvil = HCore.anvilBuilder(player) //creates anvil builder for player
.whenInputReceived(input -> System.out.println(input)) //works when input received from player
.whenOpened(() -> System.out.println("anvil opened")) //works when anvil opened
.whenClosed(() -> System.out.println("anvil closed")) //works when anvil closed
.leftItem(new ItemStack(Material.CHEST)) //item stack that to be placed on the left side of anvil
.title("Here is inventory title") //anvil title
.text("Here is input text") //text of input area
.build(); //builds the HAnvil class
anvil.open(); //opens anvil to player
}