This API has only one goal: To make the creation and the interaction of ItemStacks easy. It has a class called ItemCreator, which lets you build your own ItemStack in just one line, and a special addition, which is an InteractionListener and a InventoryClickListener configured in the ItemCreator as well.
All of the methods that the ItemCreator class provides can be found in the image below.
Here is an example, it shows the creation of a simple BlazeRod, that pushes the player in the direction he is looking when the player rightclicks, that sends a message to the player when he clicks it in his inventory.
If you have any questions regarding the API, feel free to add me on Discord: OverDodo#1535 or start a conversation here!
IMPORTANT: If you want your Items to work with Actions after a restart, create and build the items in a method that is run when the plugin is getting enabled.
Code (Text):
ItemCreator itemCreator = new ItemCreator(Material.DIAMOND);
itemCreator.handleInteraction((event) -> {
/*Allows you to put the same code you would put in the PlayerInteractEvent Handler*/
});
itemCreator.handleClick((event) -> {
/*Allows you to put the same code you would put in the InventoryClickEvent Handler*/
});
itemCreator.handleInteraction((event) -> {
/*Allows you to put the same code you would put in the PlayerInteractEvent Handler*/
});
itemCreator.handleClick((event) -> {
/*Allows you to put the same code you would put in the InventoryClickEvent Handler*/
});
Here is an example, it shows the creation of a simple BlazeRod, that pushes the player in the direction he is looking when the player rightclicks, that sends a message to the player when he clicks it in his inventory.
Code (Text):
ItemCreator creator = new ItemCreator(Material.BLAZE_ROD);
creator.setDisplayName("§cFlying Staff")
.setGlow(true)
.addLore("Makes you fly! §7(Rightclick)")
.handleInteraction((event) -> {
if(event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().multiply(5f));
event.getPlayer().sendMessage("§aYou have been pushed!");
}
}).handleClick((event) -> event.getWhoClicked().sendMessage("hey there"));
ItemStack stack = creator.build();
creator.setDisplayName("§cFlying Staff")
.setGlow(true)
.addLore("Makes you fly! §7(Rightclick)")
.handleInteraction((event) -> {
if(event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().multiply(5f));
event.getPlayer().sendMessage("§aYou have been pushed!");
}
}).handleClick((event) -> event.getWhoClicked().sendMessage("hey there"));
ItemStack stack = creator.build();
If you have any questions regarding the API, feel free to add me on Discord: OverDodo#1535 or start a conversation here!
IMPORTANT: If you want your Items to work with Actions after a restart, create and build the items in a method that is run when the plugin is getting enabled.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.12, 1.13
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
ItemUtilAPI is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.12, 1.13. Downloaded 668 times (via Spigot). Download it and open it directly in the game.