Skip to content

Instantly share code, notes, and snippets.

@Redrield
Last active April 24, 2017 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Redrield/eda048556ac05c4d03f4fd61b9034fb5 to your computer and use it in GitHub Desktop.
Save Redrield/eda048556ac05c4d03f4fd61b9034fb5 to your computer and use it in GitHub Desktop.
Inventory inv = InventoryBuilder.create("Hello", 9)
.addItem(Material.DIAMOND_AXE, 1, stack -> {
stack.withMeta(meta -> {
meta.setDisplayName("Hello world");
meta.setLore(Arrays.asList("Hello", "World"));
});
stack.getInner().addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 1000);
stack.onClick(player -> {
player.sendMessage("Executed");
});
})
.addItem(Material.WOOD_SWORD, 1, 8, stack -> {
stack.withMeta(meta -> {
meta.setDisplayName("Hello 2");
});
stack.onClick(Player::closeInventory);
}).build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment