Class in @minecraft/server
Extends ItemComponent
The potion a potion, splash potion or lingering potion holds. Read only.
import { ItemPotionComponent } from '@minecraft/server';Example
Section titled “Example”import { ItemStack, type ItemPotionComponent } from '@minecraft/server';
const item = new ItemStack('minecraft:diamond_sword');const component: ItemPotionComponent | undefined = item.getComponent('minecraft:potion');if (component) { console.log(item.typeId, component.potionDeliveryType.id);}import { ItemStack } from '@minecraft/server';
const item = new ItemStack('minecraft:diamond_sword');const component = item.getComponent('minecraft:potion');if (component) { console.log(item.typeId, component.potionDeliveryType.id);}Properties
Section titled “Properties”componentId
Section titled “componentId”static read-only
static readonly componentId = "minecraft:potion";potionDeliveryType
Section titled “potionDeliveryType”read-only
readonly potionDeliveryType: PotionDeliveryType;Types
potionEffectType
Section titled “potionEffectType”read-only
readonly potionEffectType: PotionEffectType;Types
Used by
Section titled “Used by”ItemComponentTypeMap.potion, ItemComponentTypeMap.minecraft:potion
Inherited
Section titled “Inherited”From ItemComponent: typeId, isValid