Package org.bukkit.potion
Class PotionEffectType
java.lang.Object
org.bukkit.potion.PotionEffectType
- All Implemented Interfaces:
- Keyed,- RegistryAware,- Translatable
- Direct Known Subclasses:
- PotionEffectTypeWrapper
Represents a type of potion and its effect on an entity.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final PotionEffectTypeIncreases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds.static final PotionEffectTypeTriggers an ominous event when the player enters a village or trial chambers.
 oof.static final PotionEffectTypeBlinds an entity.static final PotionEffectTypeEffects granted by a nearby conduit.static final PotionEffectTypeCauses the player's vision to dim occasionally.static final PotionEffectTypeIncreses underwater movement speed.
 Squee'ek uh'k kk'kkkk squeek eee'eek.static final PotionEffectTypeStops fire damage.static final PotionEffectTypeOutlines the entity so that it can be seen from afar.static final PotionEffectTypeIncreases dig speed.static final PotionEffectTypeIncreases the maximum health of an entity.static final PotionEffectTypeReduces the cost of villager trades.
 \o/.static final PotionEffectTypeIncreases hunger.static final PotionEffectTypeChance of spawning silverfish when hurt.static final PotionEffectTypeHurts an entity.static final PotionEffectTypeHeals an entity.static final PotionEffectTypeGrants invisibility.static final PotionEffectTypeIncreases jump height.static final PotionEffectTypeCauses the entity to float into the air.static final PotionEffectTypeLoot table luck.static final PotionEffectTypeDecreases dig speed.static final PotionEffectTypeWarps vision on the client.static final PotionEffectTypeAllows an entity to see in the dark.static final PotionEffectTypeCauses slimes to spawn upon death.static final PotionEffectTypeDeals damage to an entity over time.static final PotionEffectTypeTriggers a raid when a player enters a village.static final PotionEffectTypeRegenerates health.static final PotionEffectTypeDecreases damage dealt to an entity.static final PotionEffectTypeIncreases the food level of an entity each tick.static final PotionEffectTypeSlows entity fall rate.static final PotionEffectTypeDecreases movement speed.static final PotionEffectTypeIncreases movement speed.static final PotionEffectTypeIncreases damage dealt.static final PotionEffectTypeCauses trial spawners to become ominous.static final PotionEffectTypeLoot table unluck.static final PotionEffectTypeAllows breathing underwater.static final PotionEffectTypeDecreases damage dealt by an entity.static final PotionEffectTypeCreates cobwebs upon death.static final PotionEffectTypeEmits a wind burst upon death.static final PotionEffectTypeDeals damage to an entity over time and gives the health to the shooter.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract PotionEffectcreateEffect(int duration, int amplifier) Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.static PotionEffectTypegetById(int id) Deprecated.Magic valuestatic PotionEffectTypegetByKey(NamespacedKey key) Deprecated.only for backwards compatibility, useRegistry.get(NamespacedKey)instead.static PotionEffectTypeDeprecated.only for backwards compatibility, useRegistry.get(NamespacedKey)instead.abstract PotionEffectTypeCategoryReturns thecategoryof this effect type.abstract ColorgetColor()Returns the color of this effect type.abstract doubleDeprecated.unused, always 1.0abstract intgetId()Deprecated.Magic valueabstract NamespacedKeygetKey()Deprecated.A key might not always be present, useRegistryAware.getKeyOrThrow()instead.abstract StringgetName()Deprecated.only for backwards compatibility, usegetKey()instead.abstract booleanReturns whether the effect of this type happens once, immediately.static PotionEffectType[]values()Deprecated.useIterable.iterator().Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.registry.RegistryAwaregetKeyOrNull, getKeyOrThrow, isRegisteredMethods inherited from interface org.bukkit.TranslatablegetTranslationKey
- 
Field Details- 
SPEEDIncreases movement speed.
- 
SLOWNESSDecreases movement speed.
- 
HASTEIncreases dig speed.
- 
MINING_FATIGUEDecreases dig speed.
- 
STRENGTHIncreases damage dealt.
- 
INSTANT_HEALTHHeals an entity.
- 
INSTANT_DAMAGEHurts an entity.
- 
JUMP_BOOSTIncreases jump height.
- 
NAUSEAWarps vision on the client.
- 
REGENERATIONRegenerates health.
- 
RESISTANCEDecreases damage dealt to an entity.
- 
FIRE_RESISTANCEStops fire damage.
- 
WATER_BREATHINGAllows breathing underwater.
- 
INVISIBILITYGrants invisibility.
- 
BLINDNESSBlinds an entity.
- 
NIGHT_VISIONAllows an entity to see in the dark.
- 
HUNGERIncreases hunger.
- 
WEAKNESSDecreases damage dealt by an entity.
- 
POISONDeals damage to an entity over time.
- 
WITHERDeals damage to an entity over time and gives the health to the shooter.
- 
HEALTH_BOOSTIncreases the maximum health of an entity.
- 
ABSORPTIONIncreases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds.
- 
SATURATIONIncreases the food level of an entity each tick.
- 
GLOWINGOutlines the entity so that it can be seen from afar.
- 
LEVITATIONCauses the entity to float into the air.
- 
LUCKLoot table luck.
- 
UNLUCKLoot table unluck.
- 
SLOW_FALLINGSlows entity fall rate.
- 
CONDUIT_POWEREffects granted by a nearby conduit. Includes enhanced underwater abilities.
- 
DOLPHINS_GRACEIncreses underwater movement speed.
 Squee'ek uh'k kk'kkkk squeek eee'eek.
- 
BAD_OMENTriggers an ominous event when the player enters a village or trial chambers.
 oof.
- 
HERO_OF_THE_VILLAGEReduces the cost of villager trades.
 \o/.
- 
DARKNESSCauses the player's vision to dim occasionally.
- 
TRIAL_OMENCauses trial spawners to become ominous.
- 
RAID_OMENTriggers a raid when a player enters a village.
- 
WIND_CHARGEDEmits a wind burst upon death.
- 
WEAVINGCreates cobwebs upon death.
- 
OOZINGCauses slimes to spawn upon death.
- 
INFESTEDChance of spawning silverfish when hurt.
 
- 
- 
Constructor Details- 
PotionEffectTypepublic PotionEffectType()
 
- 
- 
Method Details- 
createEffectCreates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.- Parameters:
- duration- time in ticks
- amplifier- the effect's amplifier
- Returns:
- a resulting potion effect
- See Also:
 
- 
isInstantpublic abstract boolean isInstant()Returns whether the effect of this type happens once, immediately.- Returns:
- whether this type is normally instant
 
- 
getCategoryReturns thecategoryof this effect type.- Returns:
- the category
 
- 
getColorReturns the color of this effect type.- Returns:
- the color
 
- 
getKeyDeprecated.A key might not always be present, useRegistryAware.getKeyOrThrow()instead.Return the namespaced identifier for this object.
- 
getDurationModifierDeprecated.unused, always 1.0Returns the duration modifier applied to effects of this type.- Returns:
- duration modifier
 
- 
getIdDeprecated.Magic valueReturns the unique ID of this type.- Returns:
- Unique ID
 
- 
getNameDeprecated.only for backwards compatibility, usegetKey()instead.Returns the name of this effect type.- Returns:
- The name of this effect type
 
- 
getByKey@Contract("null -> null") @Nullable @Deprecated(since="1.20.3") public static PotionEffectType getByKey(@Nullable NamespacedKey key) Deprecated.only for backwards compatibility, useRegistry.get(NamespacedKey)instead.Gets the PotionEffectType at the specified key- Parameters:
- key- key to fetch
- Returns:
- Resulting PotionEffectType, or null if not found
 
- 
getByIdDeprecated.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 @Deprecated(since="1.20.3") public static PotionEffectType getByName(@NotNull String name) Deprecated.only for backwards compatibility, useRegistry.get(NamespacedKey)instead.Gets the effect type specified by the given name.- Parameters:
- name- Name of PotionEffectType to fetch
- Returns:
- Resulting PotionEffectType, or null if not found.
 
- 
valuesDeprecated.useIterable.iterator().- Returns:
- an array of all known PotionEffectTypes.
 
 
-