This plugin is an item API. Not much to say about it other than how to use it, so without further ado:
For Server Owners: Just drop the plugin in your plugins folder, and that's it!
For Devs:
There are two ways to use this plugin (Both can give same result):
Use the CItem class:
When to use:
- When you want a small custom item, just a doing one thing.
How to use:
- To use this class is pretty simple you create an instance of CItem by using the static method create (In CItem), there are plenty of create methods to choose from, just in case you want bytedata to lores like so:
- CItem customItem = CItem.create(Material mat, int amount, int* bytedata, String* displayName, String...* lores)
- Any arguments with * are optional
- Then, using your IDE, see the methods that you can use in customItem. The most useful methods are the ones that set an event like so:
- customItem.setRightClick(RightClick rightClick, boolean replace)
- Create a new rightClick (An interface) and choose what you want in it! replace means if there is already an event set, would you like to replace it
- New RightClick example: new RightClick() {
- @Override
- public void onRightClick(RightClickEvent event) {
- // Your code in here
- }
- }
Then do customItem.getItemStack(), which returns an itemstack you can give to the player!
Use the CustomItem interface:
When to use:
- When you want something larger than a small custom item
How to use:
- Simply create a new class that implements CustomItem, then implement the methods of CustomItem! (You will get an error on your class name, hover over it and click the option that makes the methods!)
- After you do that, create a private ItemStack and set it in the init() method, inside the method (at the bottom) getItemStack() return the itemstack you created
- Finally in your onEnable, do CItem.registerCustomItem(Your Custom Item Class Instance)