Old API

Old API

This is the old API, it's still available and working fine.
1
//check if itemsadder finished loading its items and if they are available
2
//PLEASE USE ItemsAdderFirstLoadEvent INSTEAD
3
public static boolean areItemsLoaded()
4
5
//Checks if an item is a custom item made with ItemsAdder
6
public static boolean isCustomItem(ItemStack itemStack)
7
public static boolean isCustomItem(String customItemName)
8
9
//Get an ItemsAdder custom item by its name in config
10
public static ItemStack getCustomItem(String nameInConfig)
11
12
//Spawns a block made with ItemsAdder specifying the itemstack
13
//(obtain it with getCustomItem)
14
public static void placeCustomBlock(Location location, ItemStack customBlock)
15
public static void placeCustomBlock(Location location, ItemStack customBlock, boolean lightweight)
16
17
//get custom block loots
18
public static List<ItemStack> getCustomBlockLoot(Block block, ItemStack tool, boolean includeSelfBlock)
19
20
//Check if a block in the world is a custom block made with ItemsAdder
21
public static boolean isCustomBlock(Block block)
22
23
//plants custom seed like a normal player would do
24
public static void placeCustomCrop(Location location, ItemStack seed)
25
26
//check if block is custom planted crop with custom seed
27
public static boolean isCustomCrop(Block block)
28
29
//get custom seed of custom crop
30
public static String getCustomSeedNameFromCrop(Block block)
31
32
//returns the ItemStack of a custom block in world
33
public static ItemStack getCustomBlock(Block block)
34
35
//check if an entity in world is a furniture
36
public static boolean isFurniture(Entity entity)
37
38
//check if an ItemStack is a specific custom item
39
//(example: check if a pickaxe is 'amethyst_pickaxe')
40
public static boolean matchCustomItemName(ItemStack itemStack, String customItemName)
41
42
//get name of the item in config (ex: 'ruby_pickaxe')
43
public static String getCustomItemName(ItemStack itemStack)
44
45
//get name of config where the item is declared (ex: 'items/swords')
46
public static String getCustomItemFileName(ItemStack itemStack)
47
48
//gets usages remaining of this item (-999 if it has no usages specified = infinite)
49
public static int getCustomItemUsages(ItemStack itemStack)
50
51
//set custom item durability (also works with vanilla items and with
52
//custom items with default vanilla durability)
53
public static ItemStack setCustomItemDurability(ItemStack item, int durability)
54
55
//get custom durability
56
public static int getCustomItemDurability(ItemStack itemStack)
57
58
//get max custom durability
59
public static int getCustomItemMaxDurability(ItemStack itemStack)
Copied!
Last modified 9d ago
Copy link