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

Represents a type of potion and its effect on an entity. More...

+ Inheritance diagram for org.bukkit.potion.PotionEffectType:
+ Collaboration diagram for org.bukkit.potion.PotionEffectType:

Public Member Functions

PotionEffect createEffect (int duration, int amplifier)
 Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.
 
abstract double getDurationModifier ()
 Returns the duration modifier applied to effects of this type.
 
int getId ()
 Returns the unique ID of this type.
 
abstract String getName ()
 Returns the name of this effect type.
 
abstract boolean isInstant ()
 Returns whether the effect of this type happens once, immediately.
 
boolean equals (Object obj)
 
int hashCode ()
 
String toString ()
 

Static Public Member Functions

static PotionEffectType getById (int id)
 Gets the effect type specified by the unique id.
 
static PotionEffectType getByName (String name)
 Gets the effect type specified by the given name.
 
static void registerPotionEffectType (PotionEffectType type)
 Registers an effect type with the given object.
 
static void stopAcceptingRegistrations ()
 Stops accepting any effect type registrations.
 
static PotionEffectType[] values ()
 Returns an array of all the registered PotionEffectTypes.
 

Static Public Attributes

static final PotionEffectType SPEED = new PotionEffectTypeWrapper(1)
 Increases movement speed.
 
static final PotionEffectType SLOW = new PotionEffectTypeWrapper(2)
 Decreases movement speed.
 
static final PotionEffectType FAST_DIGGING = new PotionEffectTypeWrapper(3)
 Increases dig speed.
 
static final PotionEffectType SLOW_DIGGING = new PotionEffectTypeWrapper(4)
 Decreases dig speed.
 
static final PotionEffectType INCREASE_DAMAGE = new PotionEffectTypeWrapper(5)
 Increases damage dealt.
 
static final PotionEffectType HEAL = new PotionEffectTypeWrapper(6)
 Heals an entity.
 
static final PotionEffectType HARM = new PotionEffectTypeWrapper(7)
 Hurts an entity.
 
static final PotionEffectType JUMP = new PotionEffectTypeWrapper(8)
 Increases jump height.
 
static final PotionEffectType CONFUSION = new PotionEffectTypeWrapper(9)
 Warps vision on the client.
 
static final PotionEffectType REGENERATION = new PotionEffectTypeWrapper(10)
 Regenerates health.
 
static final PotionEffectType DAMAGE_RESISTANCE = new PotionEffectTypeWrapper(11)
 Decreases damage dealt to an entity.
 
static final PotionEffectType FIRE_RESISTANCE = new PotionEffectTypeWrapper(12)
 Stops fire damage.
 
static final PotionEffectType WATER_BREATHING = new PotionEffectTypeWrapper(13)
 Allows breathing underwater.
 
static final PotionEffectType INVISIBILITY = new PotionEffectTypeWrapper(14)
 Grants invisibility.
 
static final PotionEffectType BLINDNESS = new PotionEffectTypeWrapper(15)
 Blinds an entity.
 
static final PotionEffectType NIGHT_VISION = new PotionEffectTypeWrapper(16)
 Allows an entity to see in the dark.
 
static final PotionEffectType HUNGER = new PotionEffectTypeWrapper(17)
 Increases hunger.
 
static final PotionEffectType WEAKNESS = new PotionEffectTypeWrapper(18)
 Decreases damage dealt by an entity.
 
static final PotionEffectType POISON = new PotionEffectTypeWrapper(19)
 Deals damage to an entity over time.
 
static final PotionEffectType WITHER = new PotionEffectTypeWrapper(20)
 Deals damage to an entity over time and gives the health to the shooter.
 

Protected Member Functions

 PotionEffectType (int id)
 

Detailed Description

Represents a type of potion and its effect on an entity.

Definition at line 11 of file PotionEffectType.java.

Constructor & Destructor Documentation

org.bukkit.potion.PotionEffectType.PotionEffectType ( int  id)
protected

Definition at line 114 of file PotionEffectType.java.

Referenced by org.bukkit.potion.PotionEffectType.equals().

Member Function Documentation

PotionEffect org.bukkit.potion.PotionEffectType.createEffect ( int  duration,
int  amplifier 
)

Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.

See Also
PotionBrewer::createEffect(PotionEffectType, int, int)
Parameters
durationtime in ticks
amplifierthe effect's amplifier
Returns
a resulting potion effect

Definition at line 126 of file PotionEffectType.java.

References org.bukkit.potion.PotionBrewer.createEffect(), and org.bukkit.potion.Potion.getBrewer().

boolean org.bukkit.potion.PotionEffectType.equals ( Object  obj)
static PotionEffectType org.bukkit.potion.PotionEffectType.getById ( int  id)
static

Gets the effect type specified by the unique id.

Parameters
idUnique ID to fetch
Returns
Resulting type, or null if not found.

Definition at line 196 of file PotionEffectType.java.

Referenced by org.bukkit.potion.PotionEffectTypeWrapper.getType().

static PotionEffectType org.bukkit.potion.PotionEffectType.getByName ( String  name)
static

Gets the effect type specified by the given name.

Parameters
nameName of PotionEffectType to fetch
Returns
Resulting PotionEffectType, or null if not found.

Definition at line 208 of file PotionEffectType.java.

abstract double org.bukkit.potion.PotionEffectType.getDurationModifier ( )
pure virtual

Returns the duration modifier applied to effects of this type.

Returns
duration modifier

Implemented in org.bukkit.potion.PotionEffectTypeWrapper.

Referenced by org.bukkit.potion.PotionEffectTypeWrapper.getDurationModifier().

int org.bukkit.potion.PotionEffectType.getId ( )

Returns the unique ID of this type.

Returns
Unique ID

Definition at line 142 of file PotionEffectType.java.

Referenced by org.bukkit.potion.PotionEffectTypeWrapper.getType().

abstract String org.bukkit.potion.PotionEffectType.getName ( )
pure virtual
int org.bukkit.potion.PotionEffectType.hashCode ( )

Definition at line 176 of file PotionEffectType.java.

abstract boolean org.bukkit.potion.PotionEffectType.isInstant ( )
pure virtual

Returns whether the effect of this type happens once, immediately.

Returns
whether this type is normally instant

Implemented in org.bukkit.potion.PotionEffectTypeWrapper.

Referenced by org.bukkit.potion.PotionEffectTypeWrapper.isInstant(), and org.bukkit.potion.PotionType.isInstant().

static void org.bukkit.potion.PotionEffectType.registerPotionEffectType ( PotionEffectType  type)
static

Registers an effect type with the given object.

Generally not to be used from within a plugin.

Parameters
typePotionType to register

Definition at line 220 of file PotionEffectType.java.

References org.bukkit.potion.PotionEffectType.getName().

static void org.bukkit.potion.PotionEffectType.stopAcceptingRegistrations ( )
static

Stops accepting any effect type registrations.

Definition at line 235 of file PotionEffectType.java.

String org.bukkit.potion.PotionEffectType.toString ( )
static PotionEffectType [] org.bukkit.potion.PotionEffectType.values ( )
static

Returns an array of all the registered PotionEffectTypes.

Returns
Array of types.

Definition at line 244 of file PotionEffectType.java.

Member Data Documentation

final PotionEffectType org.bukkit.potion.PotionEffectType.BLINDNESS = new PotionEffectTypeWrapper(15)
static

Blinds an entity.

Definition at line 85 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.CONFUSION = new PotionEffectTypeWrapper(9)
static

Warps vision on the client.

Definition at line 55 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.DAMAGE_RESISTANCE = new PotionEffectTypeWrapper(11)
static

Decreases damage dealt to an entity.

Definition at line 65 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.FAST_DIGGING = new PotionEffectTypeWrapper(3)
static

Increases dig speed.

Definition at line 25 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.FIRE_RESISTANCE = new PotionEffectTypeWrapper(12)
static

Stops fire damage.

Definition at line 70 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HARM = new PotionEffectTypeWrapper(7)
static

Hurts an entity.

Definition at line 45 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HEAL = new PotionEffectTypeWrapper(6)
static

Heals an entity.

Definition at line 40 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HUNGER = new PotionEffectTypeWrapper(17)
static

Increases hunger.

Definition at line 95 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.INCREASE_DAMAGE = new PotionEffectTypeWrapper(5)
static

Increases damage dealt.

Definition at line 35 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.INVISIBILITY = new PotionEffectTypeWrapper(14)
static

Grants invisibility.

Definition at line 80 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.JUMP = new PotionEffectTypeWrapper(8)
static

Increases jump height.

Definition at line 50 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.NIGHT_VISION = new PotionEffectTypeWrapper(16)
static

Allows an entity to see in the dark.

Definition at line 90 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.POISON = new PotionEffectTypeWrapper(19)
static

Deals damage to an entity over time.

Definition at line 105 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.REGENERATION = new PotionEffectTypeWrapper(10)
static

Regenerates health.

Definition at line 60 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SLOW = new PotionEffectTypeWrapper(2)
static

Decreases movement speed.

Definition at line 20 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SLOW_DIGGING = new PotionEffectTypeWrapper(4)
static

Decreases dig speed.

Definition at line 30 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SPEED = new PotionEffectTypeWrapper(1)
static

Increases movement speed.

Definition at line 15 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.WATER_BREATHING = new PotionEffectTypeWrapper(13)
static

Allows breathing underwater.

Definition at line 75 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.WEAKNESS = new PotionEffectTypeWrapper(18)
static

Decreases damage dealt by an entity.

Definition at line 100 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.WITHER = new PotionEffectTypeWrapper(20)
static

Deals damage to an entity over time and gives the health to the shooter.

Definition at line 110 of file PotionEffectType.java.


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