Package org.bukkit.potion
Class PotionEffectType
- java.lang.Object
-
- org.bukkit.potion.PotionEffectType
-
- Direct Known Subclasses:
PotionEffectTypeWrapper
public abstract class PotionEffectType extends Object
Represents a type of potion and its effect on an entity.
-
-
Field Summary
Fields Modifier and Type Field Description static PotionEffectTypeABSORPTIONIncreases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds.static PotionEffectTypeBAD_OMENoof.static PotionEffectTypeBLINDNESSBlinds an entity.static PotionEffectTypeCONDUIT_POWEREffects granted by a nearby conduit.static PotionEffectTypeCONFUSIONWarps vision on the client.static PotionEffectTypeDAMAGE_RESISTANCEDecreases damage dealt to an entity.static PotionEffectTypeDOLPHINS_GRACESquee'ek uh'k kk'kkkk squeek eee'eek.static PotionEffectTypeFAST_DIGGINGIncreases dig speed.static PotionEffectTypeFIRE_RESISTANCEStops fire damage.static PotionEffectTypeGLOWINGOutlines the entity so that it can be seen from afar.static PotionEffectTypeHARMHurts an entity.static PotionEffectTypeHEALHeals an entity.static PotionEffectTypeHEALTH_BOOSTIncreases the maximum health of an entity.static PotionEffectTypeHERO_OF_THE_VILLAGE\o/.static PotionEffectTypeHUNGERIncreases hunger.static PotionEffectTypeINCREASE_DAMAGEIncreases damage dealt.static PotionEffectTypeINVISIBILITYGrants invisibility.static PotionEffectTypeJUMPIncreases jump height.static PotionEffectTypeLEVITATIONCauses the entity to float into the air.static PotionEffectTypeLUCKLoot table luck.static PotionEffectTypeNIGHT_VISIONAllows an entity to see in the dark.static PotionEffectTypePOISONDeals damage to an entity over time.static PotionEffectTypeREGENERATIONRegenerates health.static PotionEffectTypeSATURATIONIncreases the food level of an entity each tick.static PotionEffectTypeSLOWDecreases movement speed.static PotionEffectTypeSLOW_DIGGINGDecreases dig speed.static PotionEffectTypeSLOW_FALLINGSlows entity fall rate.static PotionEffectTypeSPEEDIncreases movement speed.static PotionEffectTypeUNLUCKLoot table unluck.static PotionEffectTypeWATER_BREATHINGAllows breathing underwater.static PotionEffectTypeWEAKNESSDecreases damage dealt by an entity.static PotionEffectTypeWITHERDeals damage to an entity over time and gives the health to the shooter.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPotionEffectType(int id)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @NotNull PotionEffectcreateEffect(int duration, int amplifier)Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.booleanequals(Object obj)static @Nullable PotionEffectTypegetById(int id)Deprecated.Magic valuestatic @Nullable PotionEffectTypegetByName(@NotNull String name)Gets the effect type specified by the given name.abstract @NotNull ColorgetColor()Returns the color of this effect type.abstract doublegetDurationModifier()Deprecated.unused, always 1.0intgetId()Deprecated.Magic valueabstract @NotNull StringgetName()Returns the name of this effect type.inthashCode()abstract booleanisInstant()Returns whether the effect of this type happens once, immediately.static voidregisterPotionEffectType(@NotNull PotionEffectType type)Registers an effect type with the given object.static voidstopAcceptingRegistrations()Stops accepting any effect type registrations.StringtoString()static @NotNull PotionEffectType[]values()Returns an array of all the registeredPotionEffectTypes.
-
-
-
Field Detail
-
SPEED
public static final PotionEffectType SPEED
Increases movement speed.
-
SLOW
public static final PotionEffectType SLOW
Decreases movement speed.
-
FAST_DIGGING
public static final PotionEffectType FAST_DIGGING
Increases dig speed.
-
SLOW_DIGGING
public static final PotionEffectType SLOW_DIGGING
Decreases dig speed.
-
INCREASE_DAMAGE
public static final PotionEffectType INCREASE_DAMAGE
Increases damage dealt.
-
HEAL
public static final PotionEffectType HEAL
Heals an entity.
-
HARM
public static final PotionEffectType HARM
Hurts an entity.
-
JUMP
public static final PotionEffectType JUMP
Increases jump height.
-
CONFUSION
public static final PotionEffectType CONFUSION
Warps vision on the client.
-
REGENERATION
public static final PotionEffectType REGENERATION
Regenerates health.
-
DAMAGE_RESISTANCE
public static final PotionEffectType DAMAGE_RESISTANCE
Decreases damage dealt to an entity.
-
FIRE_RESISTANCE
public static final PotionEffectType FIRE_RESISTANCE
Stops fire damage.
-
WATER_BREATHING
public static final PotionEffectType WATER_BREATHING
Allows breathing underwater.
-
INVISIBILITY
public static final PotionEffectType INVISIBILITY
Grants invisibility.
-
BLINDNESS
public static final PotionEffectType BLINDNESS
Blinds an entity.
-
NIGHT_VISION
public static final PotionEffectType NIGHT_VISION
Allows an entity to see in the dark.
-
HUNGER
public static final PotionEffectType HUNGER
Increases hunger.
-
WEAKNESS
public static final PotionEffectType WEAKNESS
Decreases damage dealt by an entity.
-
POISON
public static final PotionEffectType POISON
Deals damage to an entity over time.
-
WITHER
public static final PotionEffectType WITHER
Deals damage to an entity over time and gives the health to the shooter.
-
HEALTH_BOOST
public static final PotionEffectType HEALTH_BOOST
Increases the maximum health of an entity.
-
ABSORPTION
public static final PotionEffectType ABSORPTION
Increases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds.
-
SATURATION
public static final PotionEffectType SATURATION
Increases the food level of an entity each tick.
-
GLOWING
public static final PotionEffectType GLOWING
Outlines the entity so that it can be seen from afar.
-
LEVITATION
public static final PotionEffectType LEVITATION
Causes the entity to float into the air.
-
LUCK
public static final PotionEffectType LUCK
Loot table luck.
-
UNLUCK
public static final PotionEffectType UNLUCK
Loot table unluck.
-
SLOW_FALLING
public static final PotionEffectType SLOW_FALLING
Slows entity fall rate.
-
CONDUIT_POWER
public static final PotionEffectType CONDUIT_POWER
Effects granted by a nearby conduit. Includes enhanced underwater abilities.
-
DOLPHINS_GRACE
public static final PotionEffectType DOLPHINS_GRACE
Squee'ek uh'k kk'kkkk squeek eee'eek.
-
BAD_OMEN
public static final PotionEffectType BAD_OMEN
oof.
-
HERO_OF_THE_VILLAGE
public static final PotionEffectType HERO_OF_THE_VILLAGE
\o/.
-
-
Method Detail
-
createEffect
@NotNull public @NotNull PotionEffect createEffect(int duration, int amplifier)
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 public abstract double getDurationModifier()
Deprecated.unused, always 1.0Returns the duration modifier applied to effects of this type.- Returns:
- duration modifier
-
getId
@Deprecated public int getId()
Deprecated.Magic valueReturns the unique ID of this type.- Returns:
- Unique ID
-
getName
@NotNull public abstract @NotNull String 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
@NotNull public abstract @NotNull Color getColor()
Returns the color of this effect type.- Returns:
- the color
-
getById
@Deprecated @Nullable public static @Nullable PotionEffectType getById(int id)
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
@Nullable public static @Nullable PotionEffectType getByName(@NotNull @NotNull String name)
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
public static void registerPotionEffectType(@NotNull @NotNull PotionEffectType type)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
@NotNull public static @NotNull PotionEffectType[] values()
Returns an array of all the registeredPotionEffectTypes. This array is not necessarily in any particular order.- Returns:
- Array of types.
-
-