Package org.bukkit.potion
Class PotionEffectType
java.lang.Object
org.bukkit.potion.PotionEffectType
- Direct Known Subclasses:
PotionEffectTypeWrapper
Represents a type of potion and its effect on an entity.
-
Field Summary
Modifier and TypeFieldDescriptionstatic PotionEffectType
Increases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds.static PotionEffectType
oof.static PotionEffectType
Blinds an entity.static PotionEffectType
Effects granted by a nearby conduit.static PotionEffectType
Warps vision on the client.static PotionEffectType
Decreases damage dealt to an entity.static PotionEffectType
Squee'ek uh'k kk'kkkk squeek eee'eek.static PotionEffectType
Increases dig speed.static PotionEffectType
Stops fire damage.static PotionEffectType
Outlines the entity so that it can be seen from afar.static PotionEffectType
Hurts an entity.static PotionEffectType
Heals an entity.static PotionEffectType
Increases the maximum health of an entity.static PotionEffectType
\o/.static PotionEffectType
Increases hunger.static PotionEffectType
Increases damage dealt.static PotionEffectType
Grants invisibility.static PotionEffectType
Increases jump height.static PotionEffectType
Causes the entity to float into the air.static PotionEffectType
Loot table luck.static PotionEffectType
Allows an entity to see in the dark.static PotionEffectType
Deals damage to an entity over time.static PotionEffectType
Regenerates health.static PotionEffectType
Increases the food level of an entity each tick.static PotionEffectType
Decreases movement speed.static PotionEffectType
Decreases dig speed.static PotionEffectType
Slows entity fall rate.static PotionEffectType
Increases movement speed.static PotionEffectType
Loot table unluck.static PotionEffectType
Allows breathing underwater.static PotionEffectType
Decreases damage dealt by an entity.static PotionEffectType
Deals damage to an entity over time and gives the health to the shooter. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateEffect(int duration, int amplifier)
Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.boolean
static PotionEffectType
getById(int id)
Deprecated.Magic valuestatic PotionEffectType
Gets the effect type specified by the given name.abstract Color
getColor()
Returns the color of this effect type.abstract double
Deprecated.unused, always 1.0int
getId()
Deprecated.Magic valueabstract String
getName()
Returns the name of this effect type.int
hashCode()
abstract boolean
Returns whether the effect of this type happens once, immediately.static void
Registers an effect type with the given object.static void
Stops accepting any effect type registrations.toString()
static PotionEffectType[]
values()
Returns an array of all the registeredPotionEffectType
s.
-
Field Details
-
SPEED
Increases movement speed. -
SLOW
Decreases movement speed. -
FAST_DIGGING
Increases dig speed. -
SLOW_DIGGING
Decreases dig speed. -
INCREASE_DAMAGE
Increases damage dealt. -
HEAL
Heals an entity. -
HARM
Hurts an entity. -
JUMP
Increases jump height. -
CONFUSION
Warps vision on the client. -
REGENERATION
Regenerates health. -
DAMAGE_RESISTANCE
Decreases damage dealt to an entity. -
FIRE_RESISTANCE
Stops fire damage. -
WATER_BREATHING
Allows breathing underwater. -
INVISIBILITY
Grants invisibility. -
BLINDNESS
Blinds an entity. -
NIGHT_VISION
Allows an entity to see in the dark. -
HUNGER
Increases hunger. -
WEAKNESS
Decreases damage dealt by an entity. -
POISON
Deals damage to an entity over time. -
WITHER
Deals damage to an entity over time and gives the health to the shooter. -
HEALTH_BOOST
Increases the maximum health of an entity. -
ABSORPTION
Increases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds. -
SATURATION
Increases the food level of an entity each tick. -
GLOWING
Outlines the entity so that it can be seen from afar. -
LEVITATION
Causes the entity to float into the air. -
LUCK
Loot table luck. -
UNLUCK
Loot table unluck. -
SLOW_FALLING
Slows entity fall rate. -
CONDUIT_POWER
Effects granted by a nearby conduit. Includes enhanced underwater abilities. -
DOLPHINS_GRACE
Squee'ek uh'k kk'kkkk squeek eee'eek. -
BAD_OMEN
oof. -
HERO_OF_THE_VILLAGE
\o/.
-
-
Constructor Details
-
PotionEffectType
protected PotionEffectType(int id)
-
-
Method Details
-
createEffect
Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.- Parameters:
duration
- time in ticksamplifier
- the effect's amplifier- Returns:
- a resulting potion effect
- See Also:
PotionBrewer.createEffect(PotionEffectType, int, int)
-
getDurationModifier
Deprecated.unused, always 1.0Returns the duration modifier applied to effects of this type.- Returns:
- duration modifier
-
getId
Deprecated.Magic valueReturns the unique ID of this type.- Returns:
- Unique ID
-
getName
Returns the name of this effect type.- Returns:
- The name of this effect type
-
isInstant
public abstract boolean isInstant()Returns whether the effect of this type happens once, immediately.- Returns:
- whether this type is normally instant
-
getColor
Returns the color of this effect type.- Returns:
- the color
-
equals
-
hashCode
public int hashCode() -
toString
-
getById
Deprecated.Magic valueGets the effect type specified by the unique id.- Parameters:
id
- Unique ID to fetch- Returns:
- Resulting type, or null if not found.
-
getByName
Gets the effect type specified by the given name.- Parameters:
name
- Name of PotionEffectType to fetch- Returns:
- Resulting PotionEffectType, or null if not found.
-
registerPotionEffectType
Registers an effect type with the given object.Generally not to be used from within a plugin.
- Parameters:
type
- PotionType to register
-
stopAcceptingRegistrations
public static void stopAcceptingRegistrations()Stops accepting any effect type registrations. -
values
Returns an array of all the registeredPotionEffectType
s. This array is not necessarily in any particular order.- Returns:
- Array of types.
-