GiftAPI
A plugin for Minecraft servers using the Bukkit 1.6.4 core.
This is both an API and a custom inventory system.
Usage
- Download the release or build the plugin yourself.
- Move it to the
ROOT-SERVER-FOLDER/plugins
directory. - Copy it into the root folder of your plugin.
- In your IDE, import
giftapi.jar
. - Use the usage example and documentation to work with the API.
- Build your plugin into a JAR file.
- Copy the resulting JAR file to
ROOT-SERVER-FOLDER/plugins
. - Start the server or run the
/reload
command.
Documentation
add(player, item)
- Description: Adds an item to the player's custom inventory.
- Parameters:
player
(Player
): The player who will receive the item.item
(ItemStack
): The item to be added to the inventory.
remove(player, item)
- Description: Removes an item from the player's custom inventory.
- Parameters:
player
(Player
): The player whose item will be removed.item
(ItemStack
): The item to be removed from the inventory.
openGUI(player)
- Description: Opens the custom inventory for the player.
- Parameters:
player
(Player
): The player whose custom inventory will be opened.
Example Usage
import tokarotik.giftapi.GiftAPI;
// Get plugin instance
Plugin plugin = Bukkit.getPluginManager().getPlugin("GiftAPI");
if (plugin != null && plugin.isEnabled() && plugin instanceof GiftAPI) {
// Set up API
GiftAPI giftAPI = (GiftAPI) plugin;
// Get the first online player
Player player = Bukkit.getOnlinePlayers()[0];
// Create an item (stick)
ItemStack item = new ItemStack(Material.STICK);
// Add item to player's custom inventory
giftAPI.add(player, item);
// Open the custom inventory GUI
giftAPI.openGUI(player);
}
Requirements
- Bukkit 1.6.4
Developer
License
This project is licensed under the MIT License.
Description
1.1
Latest
Languages
Java
100%