public class CustomTool extends CustomItem
addAttackSpeed(double)
and addAttackDamage(double)
don't
work like
CustomItem#addAttribute(com.comphenix.attribute.Attributes.AttributeType, Double, org.bukkit.inventory.EquipmentSlot, com.comphenix.attribute.Attributes.Operation)
.
Instead the attributes are added after being calculated to match those who
are displayed under Swords, Axes, Pickaxes, Shovels or Hoes. For example, to
replicate a Diamond Sword you will set an Attack Speed of 1.6 and an Attack
Damage of 7.#setAttributeVisibility(Boolean)
to hide the Attribute Text from
displaying. The strings used in the lore are customizable in the lang.yml
file.CHEST_UUID, FEET_UUID, HEAD_UUID, LEGS_UUID, LORE_PREFIX, LORE_SUFFIX, MAIN_HAND_UUID, OFF_HAND_UUID
Constructor and Description |
---|
CustomTool(org.bukkit.Material material,
int amount,
short durability,
java.lang.String idName)
Creates a Custom Tool
|
Modifier and Type | Method and Description |
---|---|
CustomTool |
addAttackDamage(double attackDamage)
This does not work like
CustomItem#addAttribute(com.comphenix.attribute.Attributes.AttributeType, Double, org.bukkit.inventory.EquipmentSlot, com.comphenix.attribute.Attributes.Operation) . |
CustomTool |
addAttackSpeed(double attackSpeed)
This does not work like
CustomItem#addAttribute(com.comphenix.attribute.Attributes.AttributeType, Double, org.bukkit.inventory.EquipmentSlot, com.comphenix.attribute.Attributes.Operation) . |
java.util.ArrayList<java.lang.String> |
getToolLikeAttributes() |
java.util.ArrayList<java.lang.String> |
getToolLikeAttributes(java.util.Map<org.bukkit.enchantments.Enchantment,java.lang.Integer> enchants,
Attributes attributes) |
ToolType |
getToolType() |
boolean |
hasToolLikeAttributes()
The Tool Like Attributes will add a lore that displays Attack Speed and
Attack Damage the same way that they are displayed in Items in Vanilla.
|
CustomTool |
setToolLikeAttributes(java.lang.Boolean lore)
The Tool Like Attributes will add a lore that displays Attack Speed and
Attack Damage the same way that they are displayed in Items in Vanilla.
|
addAllCustomRecipes, addAttribute, addAttribute, addAttribute, addCustomRecipe, addEnchantment, addForbiddenEnchantment, addForbiddenEnchantment, addItemFlag, addLoreLine, clearAttributes, clone, compareTo, getAmount, getAttributes, getAttributeVisibility, getBurnTime, getCanBePlacedVisibility, getCanDestroyVisibility, getCustomRecipes, getDisplayName, getDurability, getDurabilityMechanics, getEnchantmentVisibility, getEnchantmnets, getFakeDurability, getForbidenEnchantments, getFullLore, getIdName, getItemFlags, getItemType, getLore, getMaterial, getPermissions, getPotionEffectsVisibility, getUnbreakableVisibility, hasFakeDurability, hasHoeAbilities, isCombinableInCrafting, isEnchantable, isUnbreakable, setAmount, setAttributes, setAttributeVisibility, setBurnTime, setCanBePlacedVisibility, setCanDestroyVisibility, setCombinedInCrafting, setDisplayName, setDurability, setDurabilityMechanics, setEnchantable, setEnchantmentVisibility, setFakeDurability, setHoeAbilities, setIdName, setLore, setMaterial, setPermissions, setPotionEffectsVisibility, setUnbreakable, setUnbreakableVisibility
public CustomTool(org.bukkit.Material material, int amount, short durability, java.lang.String idName)
material
- The Material that the Custom Tool will be made of. Valid
Materials are all that include in their name SWORD, AXE,
PICKAXE, SPADE or HOE.amount
- The amount of the Custom Tool. Recommended value is 1, as
tools are not stackable by default.durability
- The Durability of the Custom Tool.idName
- the Custom Tool's ID Name. This MUST BE SIMILAR to
"vanilla_additions:emerald_sword" and is saved in the
ItemStack so you can easily detect which Custom Tool it is.public ToolType getToolType()
ToolType.getToolType(Material)
method, where material is
the Custom Tool's Material.public CustomTool addAttackSpeed(double attackSpeed)
CustomItem#addAttribute(com.comphenix.attribute.Attributes.AttributeType, Double, org.bukkit.inventory.EquipmentSlot, com.comphenix.attribute.Attributes.Operation)
.
Instead the attributes are added after being calculated to match those
who are displayed under Swords, Axes, Pickaxes, Shovels or Hoes. For
example, to replicate a Diamond Sword you will set an Attack Speed of
1.6.attackSpeed
- The Attack Speed you want the Tool to have.public CustomTool addAttackDamage(double attackDamage)
CustomItem#addAttribute(com.comphenix.attribute.Attributes.AttributeType, Double, org.bukkit.inventory.EquipmentSlot, com.comphenix.attribute.Attributes.Operation)
.
Instead the attributes are added after being calculated to match those
who are displayed under Swords, Axes, Pickaxes, Shovels or Hoes. For
example, to replicate a Diamond Sword you will set an Attack Damage of 7.attackDamage
- The Attack Damage you want the Tool to have.public CustomTool setToolLikeAttributes(java.lang.Boolean lore)
#setAttributeVisibility(Boolean)
to hide the Attribute Text from
displaying. The strings used in the lore are customizable in the lang.yml
file.lore
- Whether you want the lore to be enabled or not.public boolean hasToolLikeAttributes()
#setAttributeVisibility(Boolean)
to hide the Attribute Text from
displaying. The strings used in the lore are customizable in the lang.yml
file.public java.util.ArrayList<java.lang.String> getToolLikeAttributes()
public java.util.ArrayList<java.lang.String> getToolLikeAttributes(java.util.Map<org.bukkit.enchantments.Enchantment,java.lang.Integer> enchants, Attributes attributes)