Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.enchantments.Enchantment Class Referenceabstract

The various type of enchantments that may be added to armour or weapons. More...

+ Inheritance diagram for org.bukkit.enchantments.Enchantment:
+ Collaboration diagram for org.bukkit.enchantments.Enchantment:

Public Member Functions

 Enchantment (int id)
 
int getId ()
 Gets the unique ID of this enchantment.
 
abstract String getName ()
 Gets the unique name of this enchantment.
 
abstract int getMaxLevel ()
 Gets the maximum level that this Enchantment may become.
 
abstract int getStartLevel ()
 Gets the level that this Enchantment should start at.
 
abstract EnchantmentTarget getItemTarget ()
 Gets the type of ItemStack that may fit this Enchantment.
 
abstract boolean conflictsWith (Enchantment other)
 Check if this enchantment conflicts with another enchantment.
 
abstract boolean canEnchantItem (ItemStack item)
 Checks if this Enchantment may be applied to the given ItemStack.
 
boolean equals (Object obj)
 
int hashCode ()
 
String toString ()
 

Static Public Member Functions

static void registerEnchantment (Enchantment enchantment)
 Registers an enchantment with the given ID and object.
 
static boolean isAcceptingRegistrations ()
 Checks if this is accepting Enchantment registrations.
 
static void stopAcceptingRegistrations ()
 Stops accepting any enchantment registrations.
 
static Enchantment getById (int id)
 Gets the Enchantment at the specified ID.
 
static Enchantment getByName (String name)
 Gets the Enchantment at the specified name.
 
static Enchantment[] values ()
 Gets an array of all the registered Enchantments.
 

Static Public Attributes

static final Enchantment PROTECTION_ENVIRONMENTAL = new EnchantmentWrapper(0)
 Provides protection against environmental damage.
 
static final Enchantment PROTECTION_FIRE = new EnchantmentWrapper(1)
 Provides protection against fire damage.
 
static final Enchantment PROTECTION_FALL = new EnchantmentWrapper(2)
 Provides protection against fall damage.
 
static final Enchantment PROTECTION_EXPLOSIONS = new EnchantmentWrapper(3)
 Provides protection against explosive damage.
 
static final Enchantment PROTECTION_PROJECTILE = new EnchantmentWrapper(4)
 Provides protection against projectile damage.
 
static final Enchantment OXYGEN = new EnchantmentWrapper(5)
 Decreases the rate of air loss whilst underwater.
 
static final Enchantment WATER_WORKER = new EnchantmentWrapper(6)
 Increases the speed at which a player may mine underwater.
 
static final Enchantment THORNS = new EnchantmentWrapper(7)
 Damages the attacker.
 
static final Enchantment DAMAGE_ALL = new EnchantmentWrapper(16)
 Increases damage against all targets.
 
static final Enchantment DAMAGE_UNDEAD = new EnchantmentWrapper(17)
 Increases damage against undead targets.
 
static final Enchantment DAMAGE_ARTHROPODS = new EnchantmentWrapper(18)
 Increases damage against arthropod targets.
 
static final Enchantment KNOCKBACK = new EnchantmentWrapper(19)
 All damage to other targets will knock them back when hit.
 
static final Enchantment FIRE_ASPECT = new EnchantmentWrapper(20)
 When attacking a target, has a chance to set them on fire.
 
static final Enchantment LOOT_BONUS_MOBS = new EnchantmentWrapper(21)
 Provides a chance of gaining extra loot when killing monsters.
 
static final Enchantment DIG_SPEED = new EnchantmentWrapper(32)
 Increases the rate at which you mine/dig.
 
static final Enchantment SILK_TOUCH = new EnchantmentWrapper(33)
 Allows blocks to drop themselves instead of fragments (for example, stone instead of cobblestone)
 
static final Enchantment DURABILITY = new EnchantmentWrapper(34)
 Decreases the rate at which a tool looses durability.
 
static final Enchantment LOOT_BONUS_BLOCKS = new EnchantmentWrapper(35)
 Provides a chance of gaining extra loot when destroying blocks.
 
static final Enchantment ARROW_DAMAGE = new EnchantmentWrapper(48)
 Provides extra damage when shooting arrows from bows.
 
static final Enchantment ARROW_KNOCKBACK = new EnchantmentWrapper(49)
 Provides a knockback when an entity is hit by an arrow from a bow.
 
static final Enchantment ARROW_FIRE = new EnchantmentWrapper(50)
 Sets entities on fire when hit by arrows shot from a bow.
 
static final Enchantment ARROW_INFINITE = new EnchantmentWrapper(51)
 Provides infinite arrows when shooting a bow.
 

Detailed Description

The various type of enchantments that may be added to armour or weapons.

Definition at line 12 of file Enchantment.java.

Constructor & Destructor Documentation

org.bukkit.enchantments.Enchantment.Enchantment ( int  id)

Definition at line 128 of file Enchantment.java.

Referenced by org.bukkit.enchantments.Enchantment.equals().

Member Function Documentation

abstract boolean org.bukkit.enchantments.Enchantment.canEnchantItem ( ItemStack  item)
pure virtual

Checks if this Enchantment may be applied to the given ItemStack.

This does not check if it conflicts with any enchantmentds already applied to the item.

Parameters
itemItem to test
Returns
True if the enchantment may be applied, otherwise False

Implemented in org.bukkit.enchantments.EnchantmentWrapper.

Referenced by org.bukkit.inventory.ItemStack.addEnchantment(), org.bukkit.enchantments.EnchantmentWrapper.canEnchantItem(), and org.bukkit.command.defaults.EnchantCommand.execute().

abstract boolean org.bukkit.enchantments.Enchantment.conflictsWith ( Enchantment  other)
pure virtual

Check if this enchantment conflicts with another enchantment.

Parameters
otherThe enchantment to check against
Returns
True if there is a conflict.

Implemented in org.bukkit.enchantments.EnchantmentWrapper.

Referenced by org.bukkit.enchantments.EnchantmentWrapper.conflictsWith(), and org.bukkit.command.defaults.EnchantCommand.execute().

boolean org.bukkit.enchantments.Enchantment.equals ( Object  obj)
static Enchantment org.bukkit.enchantments.Enchantment.getById ( int  id)
static

Gets the Enchantment at the specified ID.

Parameters
idID to fetch
Returns
Resulting Enchantment, or null if not found

Definition at line 252 of file Enchantment.java.

Referenced by org.bukkit.enchantments.EnchantmentWrapper.getEnchantment().

static Enchantment org.bukkit.enchantments.Enchantment.getByName ( String  name)
static

Gets the Enchantment at the specified name.

Parameters
nameName to fetch
Returns
Resulting Enchantment, or null if not found

Definition at line 262 of file Enchantment.java.

Referenced by org.bukkit.inventory.ItemStack.deserialize().

int org.bukkit.enchantments.Enchantment.getId ( )

Gets the unique ID of this enchantment.

Returns
Unique ID

Definition at line 137 of file Enchantment.java.

Referenced by org.bukkit.enchantments.EnchantmentWrapper.getEnchantment().

abstract EnchantmentTarget org.bukkit.enchantments.Enchantment.getItemTarget ( )
pure virtual

Gets the type of ItemStack that may fit this Enchantment.

Returns
Target type of the Enchantment

Implemented in org.bukkit.enchantments.EnchantmentWrapper.

Referenced by org.bukkit.enchantments.EnchantmentWrapper.getItemTarget().

abstract int org.bukkit.enchantments.Enchantment.getMaxLevel ( )
pure virtual
abstract int org.bukkit.enchantments.Enchantment.getStartLevel ( )
pure virtual
int org.bukkit.enchantments.Enchantment.hashCode ( )

Definition at line 202 of file Enchantment.java.

static boolean org.bukkit.enchantments.Enchantment.isAcceptingRegistrations ( )
static

Checks if this is accepting Enchantment registrations.

Returns
True if the server Implementation may add enchantments

Definition at line 234 of file Enchantment.java.

Referenced by org.bukkit.enchantments.Enchantment.registerEnchantment().

static void org.bukkit.enchantments.Enchantment.registerEnchantment ( Enchantment  enchantment)
static

Registers an enchantment with the given ID and object.

Generally not to be used from within a plugin.

Parameters
enchantmentEnchantment to register

Definition at line 218 of file Enchantment.java.

References org.bukkit.enchantments.Enchantment.getName(), and org.bukkit.enchantments.Enchantment.isAcceptingRegistrations().

static void org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations ( )
static

Stops accepting any enchantment registrations.

Definition at line 241 of file Enchantment.java.

References org.bukkit.command.defaults.EnchantCommand.buildEnchantments().

String org.bukkit.enchantments.Enchantment.toString ( )

Definition at line 207 of file Enchantment.java.

References org.bukkit.enchantments.Enchantment.getName().

static Enchantment [] org.bukkit.enchantments.Enchantment.values ( )
static

Gets an array of all the registered Enchantments.

Returns
Array of enchantments

Definition at line 271 of file Enchantment.java.

Referenced by org.bukkit.command.defaults.EnchantCommand.buildEnchantments().

Member Data Documentation

final Enchantment org.bukkit.enchantments.Enchantment.ARROW_DAMAGE = new EnchantmentWrapper(48)
static

Provides extra damage when shooting arrows from bows.

Definition at line 106 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.ARROW_FIRE = new EnchantmentWrapper(50)
static

Sets entities on fire when hit by arrows shot from a bow.

Definition at line 116 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.ARROW_INFINITE = new EnchantmentWrapper(51)
static

Provides infinite arrows when shooting a bow.

Definition at line 121 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.ARROW_KNOCKBACK = new EnchantmentWrapper(49)
static

Provides a knockback when an entity is hit by an arrow from a bow.

Definition at line 111 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.DAMAGE_ALL = new EnchantmentWrapper(16)
static

Increases damage against all targets.

Definition at line 56 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.DAMAGE_ARTHROPODS = new EnchantmentWrapper(18)
static

Increases damage against arthropod targets.

Definition at line 66 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.DAMAGE_UNDEAD = new EnchantmentWrapper(17)
static

Increases damage against undead targets.

Definition at line 61 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.DIG_SPEED = new EnchantmentWrapper(32)
static

Increases the rate at which you mine/dig.

Definition at line 86 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.DURABILITY = new EnchantmentWrapper(34)
static

Decreases the rate at which a tool looses durability.

Definition at line 96 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.FIRE_ASPECT = new EnchantmentWrapper(20)
static

When attacking a target, has a chance to set them on fire.

Definition at line 76 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.KNOCKBACK = new EnchantmentWrapper(19)
static

All damage to other targets will knock them back when hit.

Definition at line 71 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.LOOT_BONUS_BLOCKS = new EnchantmentWrapper(35)
static

Provides a chance of gaining extra loot when destroying blocks.

Definition at line 101 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.LOOT_BONUS_MOBS = new EnchantmentWrapper(21)
static

Provides a chance of gaining extra loot when killing monsters.

Definition at line 81 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.OXYGEN = new EnchantmentWrapper(5)
static

Decreases the rate of air loss whilst underwater.

Definition at line 41 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.PROTECTION_ENVIRONMENTAL = new EnchantmentWrapper(0)
static

Provides protection against environmental damage.

Definition at line 16 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.PROTECTION_EXPLOSIONS = new EnchantmentWrapper(3)
static

Provides protection against explosive damage.

Definition at line 31 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.PROTECTION_FALL = new EnchantmentWrapper(2)
static

Provides protection against fall damage.

Definition at line 26 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.PROTECTION_FIRE = new EnchantmentWrapper(1)
static

Provides protection against fire damage.

Definition at line 21 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.PROTECTION_PROJECTILE = new EnchantmentWrapper(4)
static

Provides protection against projectile damage.

Definition at line 36 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.SILK_TOUCH = new EnchantmentWrapper(33)
static

Allows blocks to drop themselves instead of fragments (for example, stone instead of cobblestone)

Definition at line 91 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.THORNS = new EnchantmentWrapper(7)
static

Damages the attacker.

Definition at line 51 of file Enchantment.java.

final Enchantment org.bukkit.enchantments.Enchantment.WATER_WORKER = new EnchantmentWrapper(6)
static

Increases the speed at which a player may mine underwater.

Definition at line 46 of file Enchantment.java.


The documentation for this class was generated from the following file: