Interface SpecialItem
public interface SpecialItem
Represents the type of SpecialItem and not one for every given item to the player.
 Meaning there's only one global instance of every type.
 
 Use GameAPI.registerSpecialItem(String, Plugin, String, ItemStack) to initiate a new one.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the handler that's been called whenever someone uses an item
 UsesDeadSpecialItemUseHandleras the default onegetId()Returns the id that's being used in e.g. the shop configReturns the item that the player will receive once he purchases the item.default StringgetName()Same asgetName(CommandSender), but uses the default languagegetName(@Nullable CommandSender sender) Returns the name of this item in the language of the given sender.
 If sender is null then it'll use the default language insteadReturns the original ItemStack that's being passed during initiation.Returns the plugin that created the itemgetType()Returns the type to make it easier for you to differentiate itdefault booleanReturns whether this item has been registered usingGameAPI.registerSpecialItem(SpecialItem)booleanisSpecialItem(ItemStack itemStack) Returns whether or not the givenItemStackis running this SpecialItem when used.voidsetHandler(SpecialItemUseHandler handler) Set the handler that's been called whenever someone uses the item.
- 
Method Details- 
getTypeSpecialItemType getType()Returns the type to make it easier for you to differentiate it- Returns:
- The type of this special item
 
- 
getIdString getId()Returns the id that's being used in e.g. the shop config- Returns:
- The id of this item
 
- 
getNameSame asgetName(CommandSender), but uses the default language- Returns:
- The name of the item in the default language
 
- 
getNameReturns the name of this item in the language of the given sender.
 If sender is null then it'll use the default language instead- Parameters:
- sender- The person from which it should look up the language. Null if it should take the default language
- Returns:
- The name of the item in the language of the sender
 
- 
getItemStackItemStack getItemStack()Returns the item that the player will receive once he purchases the item.Keep in mind that this is not the original ItemStack. The plugin may add its own tags to make it unique and more identifiable from others. Use getOriginalItemStack()if you look to obtain the original one.- Returns:
- The ItemStack of the item that's useable ingame
 
- 
getOriginalItemStackItemStack getOriginalItemStack()Returns the original ItemStack that's being passed during initiation.The returned ItemStack is not usable ingame. Use getItemStack()instead if that's what you're looking for.- Returns:
- The original, non-modified ItemStack
 
- 
isSpecialItemReturns whether or not the givenItemStackis running this SpecialItem when used.- Returns:
- trueif it's the one for this SpecialItem. Otherwise- false
 
- 
getPluginPlugin getPlugin()Returns the plugin that created the item- Returns:
- The plugin that created this special item
 
- 
getHandlerSpecialItemUseHandler getHandler()Returns the handler that's been called whenever someone uses an item
 UsesDeadSpecialItemUseHandleras the default one- Returns:
- The use handler of the special item
 
- 
setHandlerSet the handler that's been called whenever someone uses the item.- Parameters:
- handler- The new use handler
 
- 
isRegistereddefault boolean isRegistered()Returns whether this item has been registered usingGameAPI.registerSpecialItem(SpecialItem)- Returns:
- Whether this item is registered
 
 
-