Skip to content

Item Recipe Builder

Hempfest edited this page Dec 12, 2021 · 4 revisions

About

Create your own custom craftable items with ease!

Building

Below is an example of building a test stick with test meta information, within the recipe shaping section you'll notice two approaches to crafting, both approaches mirror each-other and therefore should not be used in parallel unless differential enough.

		new Item()
				.setKey("an_item", PluginGoesHere)
				// setup your item key's here, can use ItemStacks instead of Materials if you want.
				.setItem('O', Material.AIR)
				.setItem('I', Material.STICK)
				// start an Item.Edit to construct the item to be crafted.
				.edit()
				.setTitle("&5&lA Test")
				.setType(Material.STICK)
				.setLore("This is a test", "&eAnd another test!")
				.complete()
				// shape the recipe.
				.shape(workbench -> {
					// A single 'item' mapped to multiple slots.
					workbench.put('O', WorkbenchSlot.ONE, WorkbenchSlot.THREE, WorkbenchSlot.FOUR, WorkbenchSlot.SIX, WorkbenchSlot.SEVEN, WorkbenchSlot.NINE);
					workbench.put('I', WorkbenchSlot.TWO, WorkbenchSlot.FIVE, WorkbenchSlot.EIGHT);

					// Or map them individually
					workbench.put(WorkbenchSlot.ONE, 'O').put(WorkbenchSlot.TWO, 'I').put(WorkbenchSlot.THREE, 'O');
					workbench.put(WorkbenchSlot.FOUR, 'O').put(WorkbenchSlot.FIVE, 'I').put(WorkbenchSlot.SIX, 'O');
					workbench.put(WorkbenchSlot.SEVEN, 'O').put(WorkbenchSlot.EIGHT, 'I').put(WorkbenchSlot.NINE, 'O');
				})
				.register();